15 package com.cloudera.impala.analysis;
17 import static com.cloudera.impala.catalog.DataSourceTable.TBL_PROP_API_VER;
18 import static com.cloudera.impala.catalog.DataSourceTable.TBL_PROP_CLASS;
19 import static com.cloudera.impala.catalog.DataSourceTable.TBL_PROP_DATA_SRC_NAME;
20 import static com.cloudera.impala.catalog.DataSourceTable.TBL_PROP_INIT_STRING;
21 import static com.cloudera.impala.catalog.DataSourceTable.TBL_PROP_LOCATION;
23 import java.util.List;
31 import com.cloudera.impala.thrift.THdfsFileFormat;
32 import com.google.common.base.Preconditions;
33 import com.google.common.base.Strings;
34 import com.google.common.collect.Lists;
35 import com.google.common.collect.Maps;
36 import org.apache.hadoop.fs.permission.FsAction;
47 String dataSourceName, String initString, String comment,
boolean ifNotExists) {
48 super(tableName, columnDefs, Lists.<
ColumnDef>newArrayList(),
false, comment,
51 Maps.<String, String>newHashMap());
59 String dataSourceName, String initString) {
60 Preconditions.checkNotNull(dataSourceName);
61 Map<String, String> tableProperties = Maps.newHashMap();
62 tableProperties.put(TBL_PROP_DATA_SRC_NAME, dataSourceName.toLowerCase());
63 tableProperties.put(TBL_PROP_INIT_STRING, Strings.nullToEmpty(initString));
64 return tableProperties;
69 super.analyze(analyzer);
71 DataSource dataSource = analyzer.getCatalog().getDataSource(dataSourceName);
72 if (dataSource == null) {
79 "not support the column type: " + col.getType());
85 String location = dataSource.getLocation();
void analyze(Analyzer analyzer)
static boolean isSupportedColumnType(Type colType)
List< ColumnDef > getColumnDefs()
CreateTableDataSrcStmt(TableName tableName, List< ColumnDef > columnDefs, String dataSourceName, String initString, String comment, boolean ifNotExists)
Map< String, String > getTblProperties()
static Map< String, String > createInitialTableProperties(String dataSourceName, String initString)