aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/example/querySubmitter.cpp
diff options
context:
space:
mode:
authorXiao Meng <xiaom.cs@gmail.com>2014-07-11 16:26:16 -0700
committerJacques Nadeau <jacques@apache.org>2014-08-11 21:32:22 -0700
commit323084b0b9ff53d9f0737748dc920ad9ca4611d0 (patch)
treeaeff790f03f34c6d253503d8b889cf850b1d33ea /contrib/native/client/example/querySubmitter.cpp
parent441886430e8cc77b60b7b90123fd2443304b7924 (diff)
DRILL-1137: C++ Client. Support setting default schema in the connection phase.
Diffstat (limited to 'contrib/native/client/example/querySubmitter.cpp')
-rw-r--r--contrib/native/client/example/querySubmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/native/client/example/querySubmitter.cpp b/contrib/native/client/example/querySubmitter.cpp
index 9d24e6885..8e806580b 100644
--- a/contrib/native/client/example/querySubmitter.cpp
+++ b/contrib/native/client/example/querySubmitter.cpp
@@ -104,6 +104,7 @@ struct Option{
{"query", "Query strings, separated by semicolons", false},
{"type", "Query type [physical|logical|sql]", true},
{"connectStr", "Connect string", true},
+ {"schema", "Default schema", false},
{"api", "API type [sync|async]", true},
{"logLevel", "Logging level [trace|debug|info|warn|error|fatal]", false}
};
@@ -236,6 +237,7 @@ int main(int argc, char* argv[]) {
std::vector<std::string*> queries;
std::string connectStr=qsOptionValues["connectStr"];
+ std::string schema=qsOptionValues["schema"];
std::string queryList=qsOptionValues["query"];
std::string planList=qsOptionValues["plan"];
std::string api=qsOptionValues["api"];
@@ -279,7 +281,7 @@ int main(int argc, char* argv[]) {
// To log to stderr
Drill::DrillClient::initLogging(NULL, l);
- if(client.connect(connectStr.c_str())!=Drill::CONN_SUCCESS){
+ if(client.connect(connectStr.c_str(), schema.c_str())!=Drill::CONN_SUCCESS){
std::cerr<< "Failed to connect with error: "<< client.getError() << " (Using:"<<connectStr<<")"<<std::endl;
return -1;
}