15 package com.cloudera.impala.analysis;
17 import org.apache.hadoop.fs.permission.FsAction;
18 import org.apache.hadoop.hive.metastore.MetaStoreUtils;
23 import com.cloudera.impala.thrift.TCreateDataSourceParams;
24 import com.cloudera.impala.thrift.TDataSource;
25 import com.google.common.base.Joiner;
26 import com.google.common.base.Preconditions;
40 String apiVersionString,
boolean ifNotExists) {
41 Preconditions.checkNotNull(dataSrcName);
42 Preconditions.checkNotNull(className);
43 Preconditions.checkNotNull(apiVersionString);
44 Preconditions.checkNotNull(location);
65 "'. Valid API versions: " + Joiner.on(
", ").join(ApiVersion.values()));
75 StringBuilder sb =
new StringBuilder();
76 sb.append(
"CREATE DATA SOURCE ");
79 sb.append(
" LOCATION '");
80 sb.append(location_.getLocation());
81 sb.append(
"' CLASS '");
83 sb.append(
"' API_VERSION '");
84 sb.append(apiVersion_.name());
90 return new TCreateDataSourceParams(
final boolean ifNotExists_
final String apiVersionString_
TCreateDataSourceParams toThrift()
void analyze(Analyzer analyzer)
static final String DATA_SRC_ALREADY_EXISTS_ERROR_MSG
final String dataSrcName_
CreateDataSrcStmt(String dataSrcName, HdfsUri location, String className, String apiVersionString, boolean ifNotExists)