This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch branch-1.17.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ad98fc249614c32e3df62e9323fe054a375a073e
Author: Alexey Serbin <ale...@apache.org>
AuthorDate: Thu Jun 15 10:35:19 2023 -0700

    [examples] make C++ example working with HMS-enabled cluster
    
    To make the example of a Kudu C++ application work in case of
    HMS-enabled Kudu cluster, the name of the test table should contain
    a database prefix.  This patch does just so, so the example now
    works against both types of Kudu clusters: with and without HMS
    integration.
    
    Change-Id: I0c2e952fb1434111cbcbef7289713c268ceebf62
    Reviewed-on: http://gerrit.cloudera.org:8080/20080
    Reviewed-by: Attila Bukor <abu...@apache.org>
    Tested-by: Kudu Jenkins
    (cherry picked from commit 7ed5a3093cea512990087a04d1f2c60df1bea7fe)
    Reviewed-on: http://gerrit.cloudera.org:8080/20094
    Reviewed-by: Yingchun Lai <laiyingc...@apache.org>
    Tested-by: Yingchun Lai <laiyingc...@apache.org>
---
 examples/cpp/example.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/cpp/example.cc b/examples/cpp/example.cc
index 5d17ac248..84511cbea 100644
--- a/examples/cpp/example.cc
+++ b/examples/cpp/example.cc
@@ -274,7 +274,11 @@ int main(int argc, char* argv[]) {
     master_addrs.push_back(argv[i]);
   }
 
-  const string kTableName = "test_table";
+  // Kudu doesn't have a notion of a database namespace, but if the integration
+  // with HMS (Hive MetaStore) is enabled, there are restriction on the name
+  // of tables that can be created, so this example adds the 'db' prefix to
+  // make it work both with and without HMS integration.
+  const string kTableName = "db.test_table";
 
   // Enable verbose debugging for the client library.
   kudu::client::SetVerboseLogLevel(2);

Reply via email to