Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Classes | |
class | DbsMetadata |
Static Public Member Functions | |
static TResultSet | getCatalogs () |
static TResultSet | getColumns (Frontend fe, String catalogName, String schemaName, String tableName, String columnName, User user) throws ImpalaException |
static TResultSet | getSchemas (Frontend fe, String catalogName, String schemaName, User user) throws ImpalaException |
static TResultSet | getTables (Frontend fe, String catalogName, String schemaName, String tableName, List< String > tableTypes, User user) throws ImpalaException |
static TResultSet | getTypeInfo () |
static TResultSet | getTableTypes () |
static TResultSet | getFunctions (Frontend fe, String catalogName, String schemaName, String functionName, User user) throws ImpalaException |
static TColumnValue | createTColumnValue (String val) |
static TColumnValue | createTColumnValue (Integer val) |
static TColumnValue | createTColumnValue (Boolean val) |
static boolean | isEmptyPattern (final String pattern) |
Static Package Functions | |
[static initializer] | |
Static Private Member Functions | |
static void | initialzeResultSetSchemas () |
static DbsMetadata | getDbsMetadata (Frontend fe, String catalogName, String schemaName, String tableName, String columnName, String functionName, User user) throws ImpalaException |
static TResultRow | createFunctionResultRow (Function fn) |
static void | createGetTypeInfoResults () |
static void | createGetTableTypesResults () |
static TResultSet | createEmptyResultSet (TResultSetMetadata metadata) |
Static Private Attributes | |
static final Logger | LOG = LoggerFactory.getLogger(MetadataOp.class) |
static final TColumnValue | NULL_COL_VAL = new TColumnValue() |
static final TColumnValue | EMPTY_COL_VAL = createTColumnValue("") |
static final TColumnValue | TABLE_TYPE_COL_VAL = createTColumnValue("TABLE") |
static final TResultSetMetadata | GET_CATALOGS_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_COLUMNS_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_SCHEMAS_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_TABLES_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_TYPEINFO_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_TABLE_TYPES_MD = new TResultSetMetadata() |
static final TResultSetMetadata | GET_FUNCTIONS_MD = new TResultSetMetadata() |
static final List< TResultRow > | GET_TYPEINFO_RESULTS = Lists.newArrayList() |
static final List< TResultRow > | GET_TABLE_TYPES_RESULTS = Lists.newArrayList() |
Metadata operation. It contains static methods to execute HiveServer2 metadata operations and return the results, result schema and an unique request id in TResultSet.
Definition at line 50 of file MetadataOp.java.
|
inlinestaticpackage |
|
inlinestaticprivate |
Returns an TResultSet with the specified schema. The result set will be empty.
Definition at line 581 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getCatalogs(), com.cloudera.impala.service.MetadataOp.getColumns(), com.cloudera.impala.service.MetadataOp.getFunctions(), com.cloudera.impala.service.MetadataOp.getSchemas(), com.cloudera.impala.service.MetadataOp.getTables(), com.cloudera.impala.service.MetadataOp.getTableTypes(), and com.cloudera.impala.service.MetadataOp.getTypeInfo().
|
inlinestaticprivate |
Create a function result row in the JDBC format.
Definition at line 489 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createTColumnValue(), com.cloudera.impala.catalog.Function.dbName(), com.cloudera.impala.service.MetadataOp.EMPTY_COL_VAL, com.cloudera.impala.catalog.Function.functionName(), com.cloudera.impala.service.MetadataOp.NULL_COL_VAL, and com.cloudera.impala.catalog.Function.signatureString().
Referenced by com.cloudera.impala.service.MetadataOp.getFunctions().
|
inlinestaticprivate |
Fills the GET_TYPEINFO_RESULTS with "TABLE".
Definition at line 570 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createTColumnValue().
|
inlinestaticprivate |
Fills the GET_TYPEINFO_RESULTS with supported primitive types.
Definition at line 532 of file MetadataOp.java.
References com.cloudera.impala.catalog.PrimitiveType.CHAR, com.cloudera.impala.service.MetadataOp.createTColumnValue(), com.cloudera.impala.catalog.PrimitiveType.DATE, com.cloudera.impala.catalog.PrimitiveType.DATETIME, com.cloudera.impala.catalog.PrimitiveType.DECIMAL, com.cloudera.impala.catalog.Type.getJavaSqlType(), com.cloudera.impala.catalog.Type.getNumPrecRadix(), com.cloudera.impala.catalog.Type.getPrecision(), com.cloudera.impala.catalog.PrimitiveType.INVALID_TYPE, com.cloudera.impala.catalog.Type.isNumericType(), com.cloudera.impala.catalog.Type.isStringType(), com.cloudera.impala.service.MetadataOp.NULL_COL_VAL, and com.cloudera.impala.catalog.PrimitiveType.VARCHAR.
|
inlinestatic |
Definition at line 589 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.createFunctionResultRow(), com.cloudera.impala.service.MetadataOp.createGetTableTypesResults(), com.cloudera.impala.service.MetadataOp.createGetTypeInfoResults(), com.cloudera.impala.service.MetadataOp.getColumns(), com.cloudera.impala.service.MetadataOp.getSchemas(), and com.cloudera.impala.service.MetadataOp.getTables().
|
inlinestatic |
Definition at line 597 of file MetadataOp.java.
|
inlinestatic |
Definition at line 605 of file MetadataOp.java.
|
inlinestatic |
Executes the GetCatalogs HiveServer2 operation and returns TResultSet. Hive does not have a catalog concept. It always returns an empty result set.
Definition at line 314 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), and com.cloudera.impala.service.MetadataOp.GET_CATALOGS_MD.
|
inlinestatic |
Executes the GetColumns HiveServer2 operation and returns TResultSet. Queries the Impala catalog to return the list of table columns that fit the search patterns. Matching columns requires loading the table metadata, so if any missing tables are found an RPC to the CatalogServer will be executed to request loading these tables. The matching process will be restarted once the required tables have been loaded in the local Impalad Catalog or the wait timeout has been reached.
The parameters catalogName, schemaName, tableName and columnName are JDBC search patterns.
Definition at line 330 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.createTColumnValue(), com.cloudera.impala.service.MetadataOp.GET_COLUMNS_MD, com.cloudera.impala.service.MetadataOp.getDbsMetadata(), com.cloudera.impala.catalog.Column.getName(), com.cloudera.impala.catalog.Column.getPosition(), com.cloudera.impala.service.MetadataOp.DbsMetadata.missingTbls, and com.cloudera.impala.service.MetadataOp.NULL_COL_VAL.
|
inlinestaticprivate |
Returns the list of schemas, tables, columns and user functions that satisfy the search pattern. catalogName, schemaName, tableName, columnName and functionName are JDBC search patterns.
The return value DbsTablesColumns.dbs contains the list of databases that satisfy the "schemaName" search pattern. DbsTablesColumns.tableNames[i] contains the list of tables inside dbs[i] that satisfy the "tableName" search pattern. DbsTablesColumns.columns[i][j] contains the list of columns of table[j] in dbs[i] that satisfy the search condition "columnName". DbsTablesColumns.functions[i] contains the list of functions inside dbs[i] that satisfy the "functionName" search pattern.
If functionName is not null, then only function metadata will be returned. If tableName is null, then DbsTablesColumns.tableNames and DbsTablesColumns.columns will not be populated. If columns is null, then DbsTablesColumns.columns will not be populated.
Definition at line 244 of file MetadataOp.java.
References com.cloudera.impala.catalog.Db.getName(), com.cloudera.impala.service.MetadataOp.isEmptyPattern(), and com.cloudera.impala.util.PatternMatcher.matches().
Referenced by com.cloudera.impala.service.MetadataOp.getColumns(), com.cloudera.impala.service.MetadataOp.getFunctions(), com.cloudera.impala.service.MetadataOp.getSchemas(), and com.cloudera.impala.service.MetadataOp.getTables().
|
inlinestatic |
Executes the GetFunctions HiveServer2 operation and returns TResultSet. Returns the list of functions that fit the search patterns. catalogName, schemaName and functionName are JDBC search patterns.
ImpalaException |
Definition at line 508 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.createFunctionResultRow(), com.cloudera.impala.service.MetadataOp.DbsMetadata.functions, com.cloudera.impala.service.MetadataOp.GET_FUNCTIONS_MD, com.cloudera.impala.service.MetadataOp.getDbsMetadata(), and com.cloudera.impala.service.MetadataOp.isEmptyPattern().
|
inlinestatic |
Executes the GetSchemas HiveServer2 operation and returns TResultSet. It queries the Impala catalog to return the list of schemas that fit the search pattern. catalogName and schemaName are JDBC search patterns.
Definition at line 397 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.createTColumnValue(), com.cloudera.impala.service.MetadataOp.EMPTY_COL_VAL, com.cloudera.impala.service.MetadataOp.GET_SCHEMAS_MD, and com.cloudera.impala.service.MetadataOp.getDbsMetadata().
|
inlinestatic |
Executes the GetTables HiveServer2 operation and returns TResultSet. It queries the Impala catalog to return the list of tables that fit the search patterns. catalogName, schemaName and tableName are JDBC search patterns. tableTypes specifies which table types to search for (TABLE, VIEW, etc).
Definition at line 425 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.createTColumnValue(), com.cloudera.impala.service.MetadataOp.EMPTY_COL_VAL, com.cloudera.impala.service.MetadataOp.GET_TABLES_MD, com.cloudera.impala.service.MetadataOp.getDbsMetadata(), and com.cloudera.impala.service.MetadataOp.TABLE_TYPE_COL_VAL.
|
inlinestatic |
Executes the GetTableTypes HiveServer2 operation.
Definition at line 480 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.GET_TABLE_TYPES_MD, and com.cloudera.impala.service.MetadataOp.GET_TABLE_TYPES_RESULTS.
|
inlinestatic |
Executes the GetTypeInfo HiveServer2 operation and returns Impala supported types.
Definition at line 471 of file MetadataOp.java.
References com.cloudera.impala.service.MetadataOp.createEmptyResultSet(), com.cloudera.impala.service.MetadataOp.GET_TYPEINFO_MD, and com.cloudera.impala.service.MetadataOp.GET_TYPEINFO_RESULTS.
|
inlinestaticprivate |
Initialize result set schema for each of the HiveServer2 operations
Definition at line 83 of file MetadataOp.java.
References com.cloudera.impala.catalog.Type.BOOLEAN, com.cloudera.impala.catalog.Type.INT, com.cloudera.impala.catalog.Type.SMALLINT, com.cloudera.impala.catalog.Type.STRING, and com.cloudera.impala.catalog.ScalarType.toThrift().
|
inlinestatic |
Returns true if the JDBC search pattern is empty: either null, empty string or "%".
Definition at line 616 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getDbsMetadata(), and com.cloudera.impala.service.MetadataOp.getFunctions().
|
staticprivate |
Definition at line 55 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.createFunctionResultRow(), com.cloudera.impala.service.MetadataOp.getSchemas(), and com.cloudera.impala.service.MetadataOp.getTables().
|
staticprivate |
Definition at line 59 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getCatalogs().
|
staticprivate |
Definition at line 60 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getColumns().
|
staticprivate |
Definition at line 65 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getFunctions().
|
staticprivate |
Definition at line 61 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getSchemas().
|
staticprivate |
Definition at line 64 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTableTypes().
|
staticprivate |
Definition at line 71 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTableTypes().
|
staticprivate |
Definition at line 62 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTables().
|
staticprivate |
Definition at line 63 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTypeInfo().
|
staticprivate |
Definition at line 68 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTypeInfo().
|
staticprivate |
Definition at line 51 of file MetadataOp.java.
|
staticprivate |
Definition at line 54 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.createFunctionResultRow(), com.cloudera.impala.service.MetadataOp.createGetTypeInfoResults(), and com.cloudera.impala.service.MetadataOp.getColumns().
|
staticprivate |
Definition at line 56 of file MetadataOp.java.
Referenced by com.cloudera.impala.service.MetadataOp.getTables().