Hi, Dominique, You got a point here. The categorical values are translated to integers internally. The integer value 0 is always reserved for empty strings (technically, the NULL values will be marked by the NULL mask separately). The parser actually allows a query to use a categorical valued column as a integer column. In this case, the test for 'col = 0' should be interpreted as "finding all empty strings" and 'col != 0' as "finding all non-empty strings."
If you data come from CSV, there is no difference between an empty string and a NULL string. Therefore, one could say this case is the tests above are for NULL values. If have a strong need to test for unspecified values, I suggested that you fill them with something. For example you expect the normal values to be between 0 and 100, you might use -1 as "NULL". If you do this, than FastBit will be simply taking -1 as just another value (anything from a user is by default 'not null'). You can query it as any other value. John On 1/30/12 2:00 PM, Dominique Prunier wrote: > Rock, > > To complement what John is saying, i found a very special corner case where > you can actually test for NULL. > In category columns, NULL is always a special key 0, and it seems that > testing a category column against a key does what you would expect. > So to test NULL or NOT NULL values, i simply does col=0 or col!=0. > > John, can you confirm this behavior ? > > Thanks, > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of John Wu > Sent: Monday, January 30, 2012 4:53 PM > To: Rock Wang; FastBit Users > Subject: Re: [FastBit-users] how to handle empty column > > Hi, Rock, > > Null values for each individual column is marked with a mask for the > column. An entire row may be marked as unusable, with a > partition-wide mask. > > At the moment, NULL values can not be queried or printed. Therefore, > if you want to use NULL values to express something definitely, you > should consider a special code in your own database design because you > can not rely on the fact FastBit to query NULL values. For example, > "a = NULL" or "a != NULL" are not supported. If you enter these > expressions, FastBit will interpret "NULL" to be a column name -- > definitely not want you want. > > Inside FastBit, if name a column in either the where clause or the > select clause, the null mask for the column is checked to make sure > the rows returned do not contain any NULL values. > > Hope this helps. > > John > > > On 1/30/12 1:00 PM, Rock Wang wrote: >> Hi John >> >> How does empty or null column is handled in fastbit? do you have examples? >> >> Thanks, >> Rock > _______________________________________________ > FastBit-users mailing list > [email protected] > https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users > _______________________________________________ > FastBit-users mailing list > [email protected] > https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users _______________________________________________ FastBit-users mailing list [email protected] https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
