Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.service.MetadataOp Class Reference
Collaboration diagram for com.cloudera.impala.service.MetadataOp:

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()
 

Detailed Description

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.

Member Function Documentation

com.cloudera.impala.service.MetadataOp.[static initializer] ( )
inlinestaticpackage
static TResultSet com.cloudera.impala.service.MetadataOp.createEmptyResultSet ( TResultSetMetadata  metadata)
inlinestaticprivate
static void com.cloudera.impala.service.MetadataOp.createGetTableTypesResults ( )
inlinestaticprivate

Fills the GET_TYPEINFO_RESULTS with "TABLE".

Definition at line 570 of file MetadataOp.java.

References com.cloudera.impala.service.MetadataOp.createTColumnValue().

static TColumnValue com.cloudera.impala.service.MetadataOp.createTColumnValue ( Integer  val)
inlinestatic

Definition at line 597 of file MetadataOp.java.

static TColumnValue com.cloudera.impala.service.MetadataOp.createTColumnValue ( Boolean  val)
inlinestatic

Definition at line 605 of file MetadataOp.java.

static TResultSet com.cloudera.impala.service.MetadataOp.getCatalogs ( )
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.

static TResultSet com.cloudera.impala.service.MetadataOp.getColumns ( Frontend  fe,
String  catalogName,
String  schemaName,
String  tableName,
String  columnName,
User  user 
) throws ImpalaException
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.

static DbsMetadata com.cloudera.impala.service.MetadataOp.getDbsMetadata ( Frontend  fe,
String  catalogName,
String  schemaName,
String  tableName,
String  columnName,
String  functionName,
User  user 
) throws ImpalaException
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().

static TResultSet com.cloudera.impala.service.MetadataOp.getFunctions ( Frontend  fe,
String  catalogName,
String  schemaName,
String  functionName,
User  user 
) throws ImpalaException
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.

Exceptions
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().

static TResultSet com.cloudera.impala.service.MetadataOp.getSchemas ( Frontend  fe,
String  catalogName,
String  schemaName,
User  user 
) throws ImpalaException
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().

static TResultSet com.cloudera.impala.service.MetadataOp.getTables ( Frontend  fe,
String  catalogName,
String  schemaName,
String  tableName,
List< String >  tableTypes,
User  user 
) throws ImpalaException
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.

static TResultSet com.cloudera.impala.service.MetadataOp.getTableTypes ( )
inlinestatic
static TResultSet com.cloudera.impala.service.MetadataOp.getTypeInfo ( )
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.

static void com.cloudera.impala.service.MetadataOp.initialzeResultSetSchemas ( )
inlinestaticprivate
static boolean com.cloudera.impala.service.MetadataOp.isEmptyPattern ( final String  pattern)
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().

Member Data Documentation

final TColumnValue com.cloudera.impala.service.MetadataOp.EMPTY_COL_VAL = createTColumnValue("")
staticprivate
final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_CATALOGS_MD = new TResultSetMetadata()
staticprivate

Definition at line 59 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getCatalogs().

final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_COLUMNS_MD = new TResultSetMetadata()
staticprivate

Definition at line 60 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getColumns().

final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_FUNCTIONS_MD = new TResultSetMetadata()
staticprivate

Definition at line 65 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getFunctions().

final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_SCHEMAS_MD = new TResultSetMetadata()
staticprivate

Definition at line 61 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getSchemas().

final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_TABLE_TYPES_MD = new TResultSetMetadata()
staticprivate
final List<TResultRow> com.cloudera.impala.service.MetadataOp.GET_TABLE_TYPES_RESULTS = Lists.newArrayList()
staticprivate
final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_TABLES_MD = new TResultSetMetadata()
staticprivate

Definition at line 62 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getTables().

final TResultSetMetadata com.cloudera.impala.service.MetadataOp.GET_TYPEINFO_MD = new TResultSetMetadata()
staticprivate

Definition at line 63 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getTypeInfo().

final List<TResultRow> com.cloudera.impala.service.MetadataOp.GET_TYPEINFO_RESULTS = Lists.newArrayList()
staticprivate

Definition at line 68 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getTypeInfo().

final Logger com.cloudera.impala.service.MetadataOp.LOG = LoggerFactory.getLogger(MetadataOp.class)
staticprivate

Definition at line 51 of file MetadataOp.java.

final TColumnValue com.cloudera.impala.service.MetadataOp.NULL_COL_VAL = new TColumnValue()
staticprivate
final TColumnValue com.cloudera.impala.service.MetadataOp.TABLE_TYPE_COL_VAL = createTColumnValue("TABLE")
staticprivate

Definition at line 56 of file MetadataOp.java.

Referenced by com.cloudera.impala.service.MetadataOp.getTables().


The documentation for this class was generated from the following file: