IMPALA-5595: Only set KuduScanner timestamp feature flag if necessary To support Kudu timestamps, Impala sets a KuduScanner flag which pads the result tuples: KuduScanner::PAD_UNIXTIME_MICROS_TO_16_BYTES
It is always set, which is correct, but means that newer versions of Impala cannot scan older Kudus even if there are no TIMESTAMP columns. Even though Impala provides no guarantees about supporting older versions of Kudu (i.e. there is no testing), the flag should just be set when there are TIMESTAMP columns since this is a known incompatibility that is easy to work around for users who are still willing to use unsupported setups. Testing: This works against the current version of Kudu (the only supported configuration). Change-Id: If5a83d2a6db97812295e6e8d37c274fe1f1dc3fb Reviewed-on: http://gerrit.cloudera.org:8080/7321 Reviewed-by: Matthew Jacobs <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/7e4f2350 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/7e4f2350 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/7e4f2350 Branch: refs/heads/master Commit: 7e4f23507197b1a9e5b10b65e85dcef064bf7070 Parents: ee640d9 Author: Matthew Jacobs <[email protected]> Authored: Wed Jun 28 12:00:26 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Thu Jun 29 04:36:53 2017 +0000 ---------------------------------------------------------------------- be/src/exec/kudu-scanner.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/7e4f2350/be/src/exec/kudu-scanner.cc ---------------------------------------------------------------------- diff --git a/be/src/exec/kudu-scanner.cc b/be/src/exec/kudu-scanner.cc index 514ebc4..1610e12 100644 --- a/be/src/exec/kudu-scanner.cc +++ b/be/src/exec/kudu-scanner.cc @@ -155,8 +155,12 @@ Status KuduScanner::OpenNextScanToken(const string& scan_token) { "Could not set scanner timeout"); VLOG_ROW << "Starting KuduScanner with ReadMode=" << mode << " timeout=" << FLAGS_kudu_operation_timeout_ms; - uint64_t row_format_flags = kudu::client::KuduScanner::PAD_UNIXTIME_MICROS_TO_16_BYTES; - scanner_->SetRowFormatFlags(row_format_flags); + + if (!timestamp_slots_.empty()) { + uint64_t row_format_flags = + kudu::client::KuduScanner::PAD_UNIXTIME_MICROS_TO_16_BYTES; + scanner_->SetRowFormatFlags(row_format_flags); + } { SCOPED_TIMER(state_->total_storage_wait_timer());
