You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2016/05/17 08:30:18 UTC

[2/4] incubator-impala git commit: Kudu: Fix warnings from clang

Kudu: Fix warnings from clang

Changes:
1) Several places in the tests didn't check return statuses.
   KUDU_ASSERT_OK can only be used in functions that return void,
   KUDU_CHECK_OK is used otherwise.
2) The forward declared "class ColumnType" should have actually been a
   struct.

Now there aren't any more Kudu related warnings from clang.

Change-Id: Id3e2f5ec9925c3cf81c7f4048decc6a5f97eee66
Reviewed-on: http://gerrit.cloudera.org:8080/3062
Reviewed-by: Dan Hecht <dh...@cloudera.com>
Tested-by: Internal 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/b634a55b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/b634a55b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/b634a55b

Branch: refs/heads/master
Commit: b634a55b9244d8e3bc9ca79280d1246455b9ed4f
Parents: 12799fa
Author: Casey Ching <ca...@cloudera.com>
Authored: Fri May 13 12:34:53 2016 -0700
Committer: Tim Armstrong <ta...@cloudera.com>
Committed: Tue May 17 01:30:12 2016 -0700

----------------------------------------------------------------------
 be/src/exec/kudu-scan-node-test.cc  | 8 ++++----
 be/src/exec/kudu-table-sink-test.cc | 4 ++--
 be/src/exec/kudu-testutil.h         | 4 ++--
 be/src/exec/kudu-util.h             | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/b634a55b/be/src/exec/kudu-scan-node-test.cc
----------------------------------------------------------------------
diff --git a/be/src/exec/kudu-scan-node-test.cc b/be/src/exec/kudu-scan-node-test.cc
index 11a04d8..b7453ee 100644
--- a/be/src/exec/kudu-scan-node-test.cc
+++ b/be/src/exec/kudu-scan-node-test.cc
@@ -224,7 +224,7 @@ class KuduScanNodeTest : public testing::Test {
     string encoded_start_key;
     if (start_key != -1) {
       scoped_ptr<KuduPartialRow> start_key_row(kudu_test_helper_.test_schema().NewRow());
-      start_key_row->SetInt32(0, start_key);
+      KUDU_ASSERT_OK(start_key_row->SetInt32(0, start_key));
       start_key_row->EncodeRowKey(&encoded_start_key);
     } else {
       encoded_start_key = "";
@@ -233,7 +233,7 @@ class KuduScanNodeTest : public testing::Test {
     string encoded_stop_key;
     if (stop_key != -1) {
       gscoped_ptr<KuduPartialRow> stop_key_row(kudu_test_helper_.test_schema().NewRow());
-      stop_key_row->SetInt32(0, stop_key);
+      KUDU_ASSERT_OK(stop_key_row->SetInt32(0, stop_key));
       stop_key_row->EncodeRowKey(&encoded_stop_key);
     } else {
       encoded_stop_key = "";
@@ -476,7 +476,7 @@ TEST_F(KuduScanNodeTest, TestScanEmptyString) {
   gscoped_ptr<KuduInsert> insert(kudu_test_helper_.table()->NewInsert());
   KUDU_ASSERT_OK(insert->mutable_row()->SetInt32(0, 10));
   KUDU_ASSERT_OK(insert->mutable_row()->SetString(2, ""));
-  session->Apply(insert.release());
+  KUDU_ASSERT_OK(session->Apply(insert.release()));
   KUDU_ASSERT_OK(session->Flush());
   ASSERT_FALSE(session->HasPendingOperations());
 
@@ -557,7 +557,7 @@ TEST_F(KuduScanNodeTest, BenchmarkScanNode) {
     for (int i = 1; i < NUM_SPLITS; ++i) {
        int split_key = (NUM_ROWS / NUM_SPLITS) * i;
        KuduPartialRow* row = kudu_test_helper_.test_schema().NewRow();
-       row->SetInt32(0, split_key);
+       KUDU_ASSERT_OK(row->SetInt32(0, split_key));
        split_rows.push_back(row);
     }
     kudu_test_helper_.CreateTable(BASE_TABLE_NAME, &split_rows);

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/b634a55b/be/src/exec/kudu-table-sink-test.cc
----------------------------------------------------------------------
diff --git a/be/src/exec/kudu-table-sink-test.cc b/be/src/exec/kudu-table-sink-test.cc
index 11dfa5e..1d5c642 100644
--- a/be/src/exec/kudu-table-sink-test.cc
+++ b/be/src/exec/kudu-table-sink-test.cc
@@ -178,8 +178,8 @@ class KuduTableSinkTest : public testing::Test {
   void Verify(int num_columns, int expected_num_rows, int factor, string val,
       int skip_val) {
     kudu::client::KuduScanner scanner(kudu_test_helper_.table().get());
-    scanner.SetReadMode(kudu::client::KuduScanner::READ_AT_SNAPSHOT);
-    scanner.SetFaultTolerant();
+    KUDU_ASSERT_OK(scanner.SetReadMode(kudu::client::KuduScanner::READ_AT_SNAPSHOT));
+    KUDU_ASSERT_OK(scanner.SetFaultTolerant());
     KUDU_ASSERT_OK(scanner.Open());
     int row_idx = 0;
     while (scanner.HasMoreRows()) {

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/b634a55b/be/src/exec/kudu-testutil.h
----------------------------------------------------------------------
diff --git a/be/src/exec/kudu-testutil.h b/be/src/exec/kudu-testutil.h
index f45d6cd..6849e74 100644
--- a/be/src/exec/kudu-testutil.h
+++ b/be/src/exec/kudu-testutil.h
@@ -134,7 +134,7 @@ class KuduTestHelper {
     for (int i = first_row; i < num_rows + first_row; i++) {
       KUDU_ASSERT_OK(session->Apply(BuildTestRow(table, i, num_cols).release()));
       if (i % 1000 == 0) {
-        session->Flush();
+        KUDU_ASSERT_OK(session->Flush());
       }
     }
     KUDU_ASSERT_OK(session->Flush());
@@ -155,7 +155,7 @@ class KuduTestHelper {
   vector<const KuduPartialRow*> DefaultSplitRows() {
     vector<const KuduPartialRow*> keys;
     KuduPartialRow* key = test_schema_.NewRow();
-    key->SetInt32(0, 5);
+    KUDU_CHECK_OK(key->SetInt32(0, 5));
     keys.push_back(key);
     return keys;
   }

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/b634a55b/be/src/exec/kudu-util.h
----------------------------------------------------------------------
diff --git a/be/src/exec/kudu-util.h b/be/src/exec/kudu-util.h
index 47debdc..e200231 100644
--- a/be/src/exec/kudu-util.h
+++ b/be/src/exec/kudu-util.h
@@ -25,8 +25,8 @@ namespace impala {
 class TExpr;
 class KuduTableDescriptor;
 class Status;
-class ColumnType;
 class TupleDescriptor;
+struct ColumnType;
 
 /// Returns false when running on an operating system that Kudu doesn't support. If this
 /// check fails, there is no way Kudu should be expected to work. Exposed for testing.