Hi dev team,
I have a question about the sort in carbon data. When we have following query: select country, area, name, salary from table_a order by country; It seems carbon will decode the country column from dictionary value to original value first, and then sort by original value. My question : Is the dictionary value order always the same with original value order? Or if we sort the dictionary value first and then decode to original value, would that be correct operation? BTW: where can I see the algorithm of Dictionary encode(class name or file name)? Thanks, Lionel |
Hi Lionel,
In case of order by it will convert the dictionary value to actual value then it will sort the data as dictionary values can not give data in sorted order because for example vishal=2 and for Lionel=3 but in query Lionel will come first then vishal, so carbon will sort based on actual value. *File name:* org.apache.spark.sql.CarbonDictionaryDecoder.scala On Thu, Feb 16, 2017 at 4:44 PM, Lu Cao <[hidden email]> wrote: > Hi dev team, > I have a question about the sort in carbon data. > When we have following query: > select country, area, name, salary from table_a order by country; > It seems carbon will decode the country column from dictionary value to > original value first, and then sort by original value. > > My question : Is the dictionary value order always the same with original > value order? > Or if we sort the dictionary value first and then decode to original value, > would that be correct operation? > > BTW: where can I see the algorithm of Dictionary encode(class name or file > name)? > > Thanks, > Lionel >
kumar vishal
|
Yes, I also think so. Thanks for the confirmation! :)
On 2/16/17, 5:24 PM, "Kumar Vishal" <[hidden email]> wrote: >Hi Lionel, >In case of order by it will convert the dictionary value to actual value >then it will sort the data as dictionary values can not give data in sorted >order because for example vishal=2 and for Lionel=3 but in query Lionel >will come first then vishal, so carbon will sort based on actual value. > >*File name:* >org.apache.spark.sql.CarbonDictionaryDecoder.scala > > > >On Thu, Feb 16, 2017 at 4:44 PM, Lu Cao <[hidden email]> wrote: > >> Hi dev team, >> I have a question about the sort in carbon data. >> When we have following query: >> select country, area, name, salary from table_a order by country; >> It seems carbon will decode the country column from dictionary value to >> original value first, and then sort by original value. >> >> My question : Is the dictionary value order always the same with original >> value order? >> Or if we sort the dictionary value first and then decode to original value, >> would that be correct operation? >> >> BTW: where can I see the algorithm of Dictionary encode(class name or file >> name)? >> >> Thanks, >> Lionel >> |
Free forum by Nabble | Edit this page |