Re: Deprecation of BaseTestQuery FYI

2018-07-05 Thread Charles Givre
Hi Paul, That was what I thought as well. The function doesn't seem to work properly either setting positive as 1 or -1. I looked at other UDFs that I’ve written in the past that return Boolean values and the implementation is almost exactly the same, so I’m a bit at a loss on this one. — C

Re: Deprecation of BaseTestQuery FYI

2018-07-05 Thread Paul Rogers
Hi Tim, My understanding is that Booleans are stored, as you said, as a UInt1 vector. But, the values are 0 and (positive) 1. As you said, singletonInt will read this value. If the value is coming back as -1, then this is a bug. I'd be surprised if it is since I wrote lots of code that assumed

Re: Deprecation of BaseTestQuery FYI

2018-07-05 Thread Charles Givre
Hi Timothy, I am still having issues with the unit tests for this particular function. The code is below. This function takes the soundex values of two strings and if they are equal is supposed to return true, if not returns false. I do this by setting the value of a BitHolder to either -1

Re: Deprecation of BaseTestQuery FYI

2018-06-28 Thread Timothy Farkas
Hi Charles, So it is actually supported. Drill's boolean vector is BitVector. Internally bits are stored efficiently, but when you fetch a bit from the vector it becomes an int, -1 for true and 0 for false. So currently you can check this by using singletonInt and comparing against -1 and 0.

Re: Deprecation of BaseTestQuery FYI

2018-06-28 Thread Timothy Farkas
Hi Charles, Currently the RowSetReader doesn't support booleans, but it can be added. I'll try to add it now, and see if it could be done quickly. I'll update you on my progress. Tim On Thu, Jun 28, 2018 at 2:38 PM, Charles Givre wrote: > Hi Tim, > Could post some sample code as to how to

Re: Deprecation of BaseTestQuery FYI

2018-06-28 Thread Charles Givre
Hi Tim, Could post some sample code as to how to test a SQL query that returns a Boolean? —C > On Jun 28, 2018, at 17:30, Timothy Farkas wrote: > > - We would have to add a boolean column reader to ColumnAccessors and wire > it in and add a getBoolean method to ScalarReader. > > - Your

Re: Deprecation of BaseTestQuery FYI

2018-06-28 Thread Timothy Farkas
- We would have to add a boolean column reader to ColumnAccessors and wire it in and add a getBoolean method to ScalarReader. - Your example should work as is, ClusterTest has a testBuilder method that allows you to use the traditional test builder. Is there something not working with the test

Re: Deprecation of BaseTestQuery FYI

2018-06-28 Thread Arina Yelchiyeva
Hi Tim, it looks like deprecating BaseTestQuery was a little bit pre-mature. For example, from in this PR - https://github.com/apache/drill/pull/1331 - Charles is trying to re-work BaseTestQuery usage to ClusterTest. First, it did not contain getSigletonDouble method which Charles has