These are chat archives for cloudera/kudu

15th
May 2018
Ricardo Gaspar
@ricardogaspar2
May 15 2018 11:03

hey, can someone help me with Kudu API?

If I wand to use more than one KuduPredicate in a Scanner, the scanner will use both together as an AND expression or an OR?

https://kudu.apache.org/apidocs/org/apache/kudu/client/KuduPredicate.html (edited)

e.g.

ColumnSchema columnSchemaUpdatedTs = table.getSchema().getColumn(TABLE_HOUSE_INFO_ACTIVE_TIPS_COLUMN_UPDATED_TS);

ColumnSchema columnSchemaDeletedTs = table.getSchema().getColumn(TABLE_HOUSE_INFO_ACTIVE_TIPS_COLUMN_ACTIVE_TIP_DELETED_TS);



KuduScanner scanner = kc.newScannerBuilder(table).addPredicate(KuduPredicate.newComparisonPredicate(columnSchemaUpdatedTs, KuduPredicate.ComparisonOp.GREATER, lastExecutionTs)).addPredicate(KuduPredicate.newComparisonPredicate(columnSchemaDeletedTs, KuduPredicate.ComparisonOp.GREATER, lastExecutionTs)).build();

In this example the scanner will filter records using columnSchemaUpdatedTs AND columnSchemaDeletedTs ? Like a

 WHERE TABLE_HOUSE_INFO_ACTIVE_TIPS_COLUMN_UPDATED_TS > lastExecutionTs AND TABLE_HOUSE_INFO_ACTIVE_TIPS_COLUMN_ACTIVE_TIP_DELETED_TS > lastExecutionTs

or it will use an OR ?

Dan Burkert
@danburkert
May 15 2018 15:31
@ricardogaspar2 they will be combined with AND. Kudu doesn't support OR predicates yet
BTW you'll find our slack instance is much more active than this room (https://getkudu-slack.herokuapp.com/)
oh woops, just saw you already asked and got an answer there :)