A UNION is special because it may cause a scan node to be started
without any scan ranges. The Kudu scanner didn't expect that scenario
and would hang waiting for data from scanner threads that would never be
started. The fix is to exit early when there are no scan ranges.
Change-Id: Id53fb880ba23ee9bbcf3169598f97fa1a3285dd9
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/10044
Reviewed-by: Casey Ching <casey@cloudera.com>
Tested-by: jenkins
The problem was, if a tuple was filtered, the bits indicating values are
NULL were not reset and the tuple's memory was reused. So NULLs from
consecutively filtered rows would accumulate in the tuple. The fix is to
always reset the NULL bits (as it doesn't matter whether the row was
filtered).
Change-Id: Ib4d980980e02bf2c82dc229a8ed1ada16bb8174f
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/9958
Tested-by: jenkins
Reviewed-by: Martin Grund <mgrund@cloudera.com>
This patch adds the backend implementation to the update. It reuses the
Kudu table sink and simply changes the KuduWriteOperation type to
Update.
Change-Id: I31e524210b9401d4619ab0f892d9fb044b6dfdea
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/6999
Reviewed-by: Martin Grund <mgrund@cloudera.com>
Tested-by: jenkins
This adds the frontend part of Kudu predicate pushdown. Namely it goes
through all the predicates that are assigned to the KuduScanNode and selects
those that are pushable to Kudu (binary predicates: <=, >= and = that have
a constant on one side and a slot ref on the other). Pushable predicates
are then set on TKuduScanNode for the backend to transform into range predicates.
Partition pruning is not handled at the moment due to limitations/bugs on the Kudu
java API.
This adds a test that makes sure that predicates are pushed down when they
match the pushable rules and are not when they don't.
Change-Id: I8f86bb8b5f6667422df7080315045d69b61dba92
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/7042
Tested-by: jenkins
Reviewed-by: David Alves <david.alves@cloudera.com>
We currently have a bug where SELECT queries with named columns
only work if the key columns are declared first.
This because, on scans, we're passing a number of key columns equal
to the number of key columns referred to by slot descriptors. The
problem is that Kudu expects key columns to come first in the schema
if the number of key columns is > 0 and we build a schema that matches
the column order in the SlotDescriptors vector, which might not have
key columns first. However Kudu scans don't actually care about
key column ordering on scans _if_ the number of key columns is set
to 0 (which is weird behavior, filed KUDU-852 for this).
This patch just changes the built Kudu schema so that we always pass
0 key columns. It also adds an end-to-end test that makes sure a
previously failing projection now works.
Change-Id: I0826dabd87493a684cfc18058a4b5aa02f7f6cdc
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/7130
Tested-by: jenkins
Reviewed-by: Daniel Hecht <dhecht@cloudera.com>
We were previously only incrementing the rows returned counter after
a full batch was processed, missing the 'num_rows_returned_' on the
scanner, which is actually used in ReachedLimit(). This caused us
to return more rows than needed when with a single node plan.
This patch fixes this and adds an update to 'rows_read_counter_'.
Moreover this patch adds a test that makes sure the limit is enforced.
Change-Id: I31c76e67fd1acb7b2bb6d31de8904954e01f9da3
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/7046
Tested-by: jenkins
Reviewed-by: David Alves <david.alves@cloudera.com>
In KuduScanner, when an empty string was returned we would try
and allocate an empty buffer getting, correctly, a NULL buffer back.
However we would interpret the NULL buffer as an inability to allocate
memory, returning a MEM_LIMIT_EXCEEDED error.
This patch special cases handling empty strings so that we just accept
the NULL buffer and don't return an error. Specifically the following
sequence of operations:
INSERT INTO TABLE (id, name) testbl VALUES (10, "");
SELECT * FROM testtbl;
Would fail with the aforementioned error and with this patch returns,
correctly:
+----+------+------+
| id | name | zip |
+----+------+------+
...
| 10 | | NULL |
+----+------+------+
Change-Id: I5eeee4b57ed3163b9c9888d694eba5dd4dd45bb5
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/7053
Tested-by: jenkins
Reviewed-by: David Alves <david.alves@cloudera.com>