Hi,

I imagine this is a stupid error on my part, but being new to Cascalog it's
not clear where the error may lie. I have the following file:

counts-by-id.txt
-----------------------
4751 5
19716 107
20012 62
20019 40
20021 71
20024 66
20030 61
20128 86
20506 54
20585 49

I am trying to run the following query:

(def count-tap
   (lfs-delimited "counts-by-id.txt"
                  :delimiter "\t"
                  :outfields ["?id" "?count"]
                  :classes [Long Long]))

(?<- (stdout) [?id ?count]
      ((select-fields count-tap ["?id" "?count"]) ?id ?count))

But I get this error:

IllegalArgumentException No implementation of method: :select-fields of
protocol: #'cascalog.api/ISelectFields found for class:
cascalog.cascading.tap.CascalogTap clojure.core/-cache-protocol-fn
(core_deftype.clj:541)

Could anyone point out either what I'm doing wrong or what steps I can take
to determine that myself?

Thanks in advance for any help,

- J.

--
You received this message because you are subscribed to the Google Groups "cascalog-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • J. McConnell at Dec 12, 2013 at 5:46 pm
    Do lfs-delimited and hfs-delimited require a name-vars call? Reading the
    docs, I assumed the :outfields parameter would take care of that. Am I
    misunderstanding how that's used? The code below illustrates what I'm
    seeing:

    ; This returns the counts, as expected
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
                                       :outfields ["?id" "?count"]
                                       :classes [Long Long])
           src (name-vars counts-by-id ["?id" "?count"])]
       (?<- (stdout) [?count] ((select-fields src ["?count"]) ?count)))

    ; This fails with the IllegalArgumentException I posted below
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
                                       :outfields ["?id" "?count"]
                                       :classes [Long Long])]
       (?<- (stdout) [?count] ((select-fields counts-by-id ["?count"]) ?count)))

    I expected these to be equivalent calls. No?

    Thanks,

    - J.
    On Wednesday, December 11, 2013 2:57:22 PM UTC-5, J. McConnell wrote:

    Hi,

    I imagine this is a stupid error on my part, but being new to Cascalog
    it's not clear where the error may lie. I have the following file:

    counts-by-id.txt
    -----------------------
    4751 5
    19716 107
    20012 62
    20019 40
    20021 71
    20024 66
    20030 61
    20128 86
    20506 54
    20585 49

    I am trying to run the following query:

    (def count-tap
    (lfs-delimited "counts-by-id.txt"
    :delimiter "\t"
    :outfields ["?id" "?count"]
    :classes [Long Long]))

    (?<- (stdout) [?id ?count]
    ((select-fields count-tap ["?id" "?count"]) ?id ?count))

    But I get this error:

    IllegalArgumentException No implementation of method: :select-fields of
    protocol: #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap clojure.core/-cache-protocol-fn
    (core_deftype.clj:541)

    Could anyone point out either what I'm doing wrong or what steps I can
    take to determine that myself?

    Thanks in advance for any help,

    - J.
    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • J. McConnell at Dec 12, 2013 at 7:39 pm
    I'm wondering if this isn't a bug? Should CascalogTap either implement Tap
    or, at least extend the ISelectFields protocol? Evaluating this allowed the
    second form to run as expected:

       (extend-protocol ISelectFields
           cascalog.cascading.tap.CascalogTap
           (select-fields [tap fields]
             (-> (types/generator tap)
                 (ops/select* fields))))

    I don't know whether that is the correct implementation or not, I just
    copied the Tap implementation, assuming CascalogTap is likely meant to be a
    type of Tap.

    Thoughts?

    - J.


    On Thu, Dec 12, 2013 at 12:46 PM, J. McConnell
    wrote:
    Do lfs-delimited and hfs-delimited require a name-vars call? Reading the
    docs, I assumed the :outfields parameter would take care of that. Am I
    misunderstanding how that's used? The code below illustrates what I'm
    seeing:

    ; This returns the counts, as expected
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])
    src (name-vars counts-by-id ["?id" "?count"])]
    (?<- (stdout) [?count] ((select-fields src ["?count"]) ?count)))

    ; This fails with the IllegalArgumentException I posted below
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])]
    (?<- (stdout) [?count] ((select-fields counts-by-id ["?count"]) ?count)))

    I expected these to be equivalent calls. No?

    Thanks,

    - J.
    On Wednesday, December 11, 2013 2:57:22 PM UTC-5, J. McConnell wrote:

    Hi,

    I imagine this is a stupid error on my part, but being new to Cascalog
    it's not clear where the error may lie. I have the following file:

    counts-by-id.txt
    -----------------------
    4751 5
    19716 107
    20012 62
    20019 40
    20021 71
    20024 66
    20030 61
    20128 86
    20506 54
    20585 49

    I am trying to run the following query:

    (def count-tap
    (lfs-delimited "counts-by-id.txt"
    :delimiter "\t"
    :outfields ["?id" "?count"]
    :classes [Long Long]))

    (?<- (stdout) [?id ?count]
    ((select-fields count-tap ["?id" "?count"]) ?id ?count))

    But I get this error:

    IllegalArgumentException No implementation of method: :select-fields of
    protocol: #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap clojure.core/-cache-protocol-fn
    (core_deftype.clj:541)

    Could anyone point out either what I'm doing wrong or what steps I can
    take to determine that myself?

    Thanks in advance for any help,

    - J.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    J. McConnell
    Founder, Übermensch Consulting

    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Sam Ritchie at Dec 12, 2013 at 7:44 pm
    Yeah, I think that it probably should. Patch?

    J. McConnell wrote:
    I'm wondering if this isn't a bug? Should CascalogTap either implement
    Tap or, at least extend the ISelectFields protocol? Evaluating this
    allowed the second form to run as expected:

    (extend-protocol ISelectFields
    cascalog.cascading.tap.CascalogTap
    (select-fields [tap fields]
    (-> (types/generator tap)
    (ops/select* fields))))

    I don't know whether that is the correct implementation or not, I just
    copied the Tap implementation, assuming CascalogTap is likely meant to
    be a type of Tap.

    Thoughts?

    - J.


    On Thu, Dec 12, 2013 at 12:46 PM, J. McConnell
    wrote:

    Do lfs-delimited and hfs-delimited require a name-vars call?
    Reading the docs, I assumed the :outfields parameter would take
    care of that. Am I misunderstanding how that's used? The code
    below illustrates what I'm seeing:

    ; This returns the counts, as expected
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])
    src (name-vars counts-by-id ["?id" "?count"])]
    (?<- (stdout) [?count] ((select-fields src ["?count"]) ?count)))

    ; This fails with the IllegalArgumentException I posted below
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])]
    (?<- (stdout) [?count] ((select-fields counts-by-id ["?count"])
    ?count)))

    I expected these to be equivalent calls. No?

    Thanks,

    - J.

    On Wednesday, December 11, 2013 2:57:22 PM UTC-5, J. McConnell wrote:

    Hi,

    I imagine this is a stupid error on my part, but being new to
    Cascalog it's not clear where the error may lie. I have the
    following file:

    counts-by-id.txt
    -----------------------
    47515
    19716107
    2001262
    2001940
    2002171
    2002466
    2003061
    2012886
    2050654
    2058549

    I am trying to run the following query:

    (def count-tap
    (lfs-delimited "counts-by-id.txt"
    :delimiter "\t"
    :outfields ["?id" "?count"]
    :classes [Long Long]))
    (?<- (stdout) [?id ?count]
    ((select-fields count-tap ["?id" "?count"]) ?id ?count))

    But I get this error:

    IllegalArgumentException No implementation of method:
    :select-fields of protocol: #'cascalog.api/ISelectFields found
    for class: cascalog.cascading.tap.CascalogTap
    clojure.core/-cache-protocol-fn (core_deftype.clj:541)

    Could anyone point out either what I'm doing wrong or what
    steps I can take to determine that myself?

    Thanks in advance for any help,

    - J.

    --
    You received this message because you are subscribed to a topic in
    the Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email
    to cascalog-user+unsubscribe@googlegroups.com
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    J. McConnell
    Founder, Übermensch Consulting
    --
    You received this message because you are subscribed to the Google
    Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    Sam Ritchie (@sritchie)
    Paddleguru Co-Founder
    703.863.8561
    www.paddleguru.com <http://www.paddleguru.com/>
    Twitter <http://twitter.com/paddleguru>// Facebook
    <http://facebook.com/paddleguru>

    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • J. McConnell at Dec 13, 2013 at 2:47 pm
    Here you go, let me know if this wasn't what you were expecting.

    On Thu, Dec 12, 2013 at 2:43 PM, Sam Ritchie wrote:

    Yeah, I think that it probably should. Patch?

    J. McConnell wrote:

    I'm wondering if this isn't a bug? Should CascalogTap either implement Tap
    or, at least extend the ISelectFields protocol? Evaluating this allowed the
    second form to run as expected:

    (extend-protocol ISelectFields
    cascalog.cascading.tap.CascalogTap
    (select-fields [tap fields]
    (-> (types/generator tap)
    (ops/select* fields))))

    I don't know whether that is the correct implementation or not, I just
    copied the Tap implementation, assuming CascalogTap is likely meant to be a
    type of Tap.

    Thoughts?

    - J.


    On Thu, Dec 12, 2013 at 12:46 PM, J. McConnell <j@ubermenschconsulting.com
    wrote:
    Do lfs-delimited and hfs-delimited require a name-vars call? Reading the
    docs, I assumed the :outfields parameter would take care of that. Am I
    misunderstanding how that's used? The code below illustrates what I'm
    seeing:

    ; This returns the counts, as expected
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])
    src (name-vars counts-by-id ["?id" "?count"])]
    (?<- (stdout) [?count] ((select-fields src ["?count"]) ?count)))

    ; This fails with the IllegalArgumentException I posted below
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])]
    (?<- (stdout) [?count] ((select-fields counts-by-id ["?count"])
    ?count)))

    I expected these to be equivalent calls. No?

    Thanks,

    - J.
    On Wednesday, December 11, 2013 2:57:22 PM UTC-5, J. McConnell wrote:

    Hi,

    I imagine this is a stupid error on my part, but being new to Cascalog
    it's not clear where the error may lie. I have the following file:

    counts-by-id.txt
    -----------------------
    4751 5
    19716 107
    20012 62
    20019 40
    20021 71
    20024 66
    20030 61
    20128 86
    20506 54
    20585 49

    I am trying to run the following query:

    (def count-tap
    (lfs-delimited "counts-by-id.txt"
    :delimiter "\t"
    :outfields ["?id" "?count"]
    :classes [Long Long]))

    (?<- (stdout) [?id ?count]
    ((select-fields count-tap ["?id" "?count"]) ?id ?count))

    But I get this error:

    IllegalArgumentException No implementation of method: :select-fields of
    protocol: #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap clojure.core/-cache-protocol-fn
    (core_deftype.clj:541)

    Could anyone point out either what I'm doing wrong or what steps I can
    take to determine that myself?

    Thanks in advance for any help,

    - J.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    J. McConnell
    Founder, Übermensch Consulting
    --
    You received this message because you are subscribed to the Google Groups
    "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cascalog-user+unsubscribe@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Sam Ritchie (@sritchie)
    Paddleguru Co-Founder
    703.863.8561
    www.paddleguru.com
    Twitter <http://twitter.com/paddleguru> // Facebook<http://facebook.com/paddleguru>

    --
    You received this message because you are subscribed to a topic in the
    Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    J. McConnell
    Founder, Übermensch Consulting

    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Soren Macbeth at Dec 13, 2013 at 9:14 pm
    good catch on this. I've implemented you patch as a pull request here

    https://github.com/nathanmarz/cascalog/pull/222

    which I will merge in shortly :)
    On Friday, 13 December 2013 06:47:05 UTC-8, J. McConnell wrote:

    Here you go, let me know if this wasn't what you were expecting.


    On Thu, Dec 12, 2013 at 2:43 PM, Sam Ritchie <sritc...@gmail.com<javascript:>
    wrote:
    Yeah, I think that it probably should. Patch?

    J. McConnell wrote:

    I'm wondering if this isn't a bug? Should CascalogTap either implement
    Tap or, at least extend the ISelectFields protocol? Evaluating this allowed
    the second form to run as expected:

    (extend-protocol ISelectFields
    cascalog.cascading.tap.CascalogTap
    (select-fields [tap fields]
    (-> (types/generator tap)
    (ops/select* fields))))

    I don't know whether that is the correct implementation or not, I just
    copied the Tap implementation, assuming CascalogTap is likely meant to be a
    type of Tap.

    Thoughts?

    - J.


    On Thu, Dec 12, 2013 at 12:46 PM, J. McConnell <
    j...@ubermenschconsulting.com <javascript:>> wrote:
    Do lfs-delimited and hfs-delimited require a name-vars call? Reading the
    docs, I assumed the :outfields parameter would take care of that. Am I
    misunderstanding how that's used? The code below illustrates what I'm
    seeing:

    ; This returns the counts, as expected
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])
    src (name-vars counts-by-id ["?id" "?count"])]
    (?<- (stdout) [?count] ((select-fields src ["?count"]) ?count)))

    ; This fails with the IllegalArgumentException I posted below
    (let [counts-by-id (lfs-delimited "resources/counts-by-id.txt"
    :outfields ["?id" "?count"]
    :classes [Long Long])]
    (?<- (stdout) [?count] ((select-fields counts-by-id ["?count"])
    ?count)))

    I expected these to be equivalent calls. No?

    Thanks,

    - J.
    On Wednesday, December 11, 2013 2:57:22 PM UTC-5, J. McConnell wrote:

    Hi,

    I imagine this is a stupid error on my part, but being new to Cascalog
    it's not clear where the error may lie. I have the following file:

    counts-by-id.txt
    -----------------------
    4751 5
    19716 107
    20012 62
    20019 40
    20021 71
    20024 66
    20030 61
    20128 86
    20506 54
    20585 49

    I am trying to run the following query:

    (def count-tap
    (lfs-delimited "counts-by-id.txt"
    :delimiter "\t"
    :outfields ["?id" "?count"]
    :classes [Long Long]))

    (?<- (stdout) [?id ?count]
    ((select-fields count-tap ["?id" "?count"]) ?id ?count))

    But I get this error:

    IllegalArgumentException No implementation of method: :select-fields of
    protocol: #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap clojure.core/-cache-protocol-fn
    (core_deftype.clj:541)

    Could anyone point out either what I'm doing wrong or what steps I can
    take to determine that myself?

    Thanks in advance for any help,

    - J.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    cascalog-use...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    J. McConnell
    Founder, Übermensch Consulting
    --
    You received this message because you are subscribed to the Google Groups
    "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cascalog-use...@googlegroups.com <javascript:>.

    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Sam Ritchie (@sritchie)
    Paddleguru Co-Founder
    703.863.8561
    www.paddleguru.com
    Twitter <http://twitter.com/paddleguru> // Facebook<http://facebook.com/paddleguru>

    --
    You received this message because you are subscribed to a topic in the
    Google Groups "cascalog-user" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cascalog-user/axrjZQVOLNo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    cascalog-use...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    J. McConnell
    Founder, Übermensch Consulting
    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Sindhu hosamane at Apr 9, 2014 at 12:49 pm
    Hi , have the same error mentioned above
    " No implementation of method: :select-fields of protocol:
    #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap" . i didn't understand whats the fix
    from above discussion .
    I am using cascalog 2.0.0 , hfs-delimited with select fields. previously it
    was working fine when i used cascalog "1.10.2-SNAPSHOT".

    In my project.clj looks like
    :dependencies [[cascalog "2.0.0"] [org.clojure/clojure "1.5.1"]]


    code looks like :

    (def info

           (hfs-delimited "/messages_new.txt"

                            :delimiter ";"

                            :outfields ["?timestamp" "?assembly" "?category" ]

                            :skip-header? false))



    (def info-tap

       (<- [?timestamp ?assembly]

           ((select-fields info ["?timestamp" "?assembly" ]) ?timestamp
    ?assembly )))

    - Sindhu



    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andy Xue at Apr 11, 2014 at 4:29 am
    this has been patched in cascalog 2.1.0
    On Wednesday, April 9, 2014 8:49:48 AM UTC-4, sindhu hosamane wrote:

    Hi , have the same error mentioned above
    " No implementation of method: :select-fields of protocol:
    #'cascalog.api/ISelectFields found for class:
    cascalog.cascading.tap.CascalogTap" . i didn't understand whats the fix
    from above discussion .
    I am using cascalog 2.0.0 , hfs-delimited with select fields. previously
    it was working fine when i used cascalog "1.10.2-SNAPSHOT".

    In my project.clj looks like
    :dependencies [[cascalog "2.0.0"] [org.clojure/clojure "1.5.1"]]


    code looks like :

    (def info

    (hfs-delimited "/messages_new.txt"

    :delimiter ";"

    :outfields ["?timestamp" "?assembly" "?category" ]

    :skip-header? false))



    (def info-tap

    (<- [?timestamp ?assembly]

    ((select-fields info ["?timestamp" "?assembly" ]) ?timestamp
    ?assembly )))

    - Sindhu


    --
    You received this message because you are subscribed to the Google Groups "cascalog-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcascalog-user @
categoriesclojure, hadoop
postedDec 11, '13 at 7:57p
activeApr 11, '14 at 4:29a
posts8
users5
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2021 Grokbase