Re: [go-nuts] Re: Anyway to print the exact cql query being executed against db
No problem. Let me know how it works out, I'm going to try it myself sometime next week. On Wed, Apr 11, 2018 at 11:42 AM, Rajuwrote: > Thanks, Lee. I will give it a try > > -Raju > > > On Wednesday, April 11, 2018 at 8:39:57 AM UTC-7, Lee Painton wrote: >> >> I have not tried this yet, but if you set up a >> https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I >> believe you can get exhaustive metrics including the executed statement. >> >> On Wednesday, April 11, 2018 at 12:42:28 AM UTC-4, Raju wrote: >>> >>> By the way, I am using gocql package - https://github.com/gocql/gocql >>> >>> >>> >>> On Tuesday, April 10, 2018 at 9:39:23 PM UTC-7, Raju wrote: Hi, Assuming my query using an iterator looks like this. Is there any way to print the exact cql query that is finally executed on Cassandra side when iter.Scan() is called? My iter query is returning empty results, but when I manually search using the cql query in my database table in Cassandra, I am getting records returned. I have a feeling the query I am creating is somehow incorrect. I would like to debug Thanks Raju // list all tweets iter := session.Query(`SELECT id, text FROM tweet WHERE timeline = ?`, "me").Iter() for iter.Scan(, ) { fmt.Println("Tweet:", id, text) } if err := iter.Close(); err != nil { log.Fatal(err) } -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Anyway to print the exact cql query being executed against db
Thanks, Lee. I will give it a try -Raju On Wednesday, April 11, 2018 at 8:39:57 AM UTC-7, Lee Painton wrote: > > I have not tried this yet, but if you set up a > https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I > believe you can get exhaustive metrics including the executed statement. > > On Wednesday, April 11, 2018 at 12:42:28 AM UTC-4, Raju wrote: >> >> By the way, I am using gocql package - https://github.com/gocql/gocql >> >> >> >> On Tuesday, April 10, 2018 at 9:39:23 PM UTC-7, Raju wrote: >>> >>> Hi, >>> >>> Assuming my query using an iterator looks like this. Is there any way to >>> print the exact cql query that is finally executed on Cassandra side when >>> iter.Scan() is called? >>> >>> My iter query is returning empty results, but when I manually search >>> using the cql query in my database table in Cassandra, I am getting records >>> returned. I have a feeling the query I am creating is somehow incorrect. I >>> would like to debug >>> >>> Thanks >>> Raju >>> >>> >>> // list all tweets >>> iter := session.Query(`SELECT id, text FROM tweet WHERE timeline = ?`, >>> "me").Iter() >>> for iter.Scan(, ) { >>> fmt.Println("Tweet:", id, text) >>> } >>> if err := iter.Close(); err != nil { >>> log.Fatal(err) >>> } >>> >>> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Anyway to print the exact cql query being executed against db
I have not tried this yet, but if you set up a https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I believe you can get exhaustive metrics including the executed statement. On Wednesday, April 11, 2018 at 12:42:28 AM UTC-4, Raju wrote: > > By the way, I am using gocql package - https://github.com/gocql/gocql > > > > On Tuesday, April 10, 2018 at 9:39:23 PM UTC-7, Raju wrote: >> >> Hi, >> >> Assuming my query using an iterator looks like this. Is there any way to >> print the exact cql query that is finally executed on Cassandra side when >> iter.Scan() is called? >> >> My iter query is returning empty results, but when I manually search >> using the cql query in my database table in Cassandra, I am getting records >> returned. I have a feeling the query I am creating is somehow incorrect. I >> would like to debug >> >> Thanks >> Raju >> >> >> // list all tweets >> iter := session.Query(`SELECT id, text FROM tweet WHERE timeline = ?`, >> "me").Iter() >> for iter.Scan(, ) { >> fmt.Println("Tweet:", id, text) >> } >> if err := iter.Close(); err != nil { >> log.Fatal(err) >> } >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Anyway to print the exact cql query being executed against db
By the way, I am using gocql package - https://github.com/gocql/gocql On Tuesday, April 10, 2018 at 9:39:23 PM UTC-7, Raju wrote: > > Hi, > > Assuming my query using an iterator looks like this. Is there any way to > print the exact cql query that is finally executed on Cassandra side when > iter.Scan() is called? > > My iter query is returning empty results, but when I manually search using > the cql query in my database table in Cassandra, I am getting records > returned. I have a feeling the query I am creating is somehow incorrect. I > would like to debug > > Thanks > Raju > > > // list all tweets > iter := session.Query(`SELECT id, text FROM tweet WHERE timeline = ?`, > "me").Iter() > for iter.Scan(, ) { > fmt.Println("Tweet:", id, text) > } > if err := iter.Close(); err != nil { > log.Fatal(err) > } > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.