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

Public Member Functions

 View (TableId id, org.apache.hadoop.hive.metastore.api.Table msTable, Db db, String name, String owner)
 
 View (String alias, QueryStmt queryStmt)
 
void load (Table oldValue, HiveMetaStoreClient client, org.apache.hadoop.hive.metastore.api.Table msTbl) throws TableLoadingException
 
TCatalogObjectType getCatalogObjectType ()
 
QueryStmt getQueryStmt ()
 
String getOriginalViewDef ()
 
String getInlineViewDef ()
 
int getNumNodes ()
 
boolean isLocalView ()
 
TTableDescriptor toThriftDescriptor (Set< Long > referencedPartitions)
 
TTable toThrift ()
 
void addColumn (Column col)
 
void clearColumns ()
 
void updateLastDdlTime (long ddlTime)
 
void validate () throws TableLoadingException
 
TCatalogObject toTCatalogObject ()
 
Db getDb ()
 
String getName ()
 
String getFullName ()
 
TableName getTableName ()
 
String getOwner ()
 
ArrayList< ColumngetColumns ()
 
List< String > getColumnNames ()
 
String getStorageHandlerClassName ()
 
ArrayList< ColumngetColumnsInHiveOrder ()
 
List< ColumngetNonClusteringColumns ()
 
Column getColumn (String name)
 
org.apache.hadoop.hive.metastore.api.Table getMetaStoreTable ()
 
int getNumClusteringCols ()
 
TableId getId ()
 
long getNumRows ()
 
ArrayType getType ()
 
long getCatalogVersion ()
 
void setCatalogVersion (long catalogVersion)
 
boolean isLoaded ()
 

Static Public Member Functions

static Table fromMetastoreTable (TableId id, Db db, org.apache.hadoop.hive.metastore.api.Table msTbl)
 
static Table fromThrift (Db parentDb, TTable thriftTable) throws TableLoadingException
 

Protected Member Functions

void loadFromThrift (TTable t) throws TableLoadingException
 
List< String > getColumnNamesWithHmsStats ()
 
void loadAllColumnStats (HiveMetaStoreClient client)
 
Type parseColumnType (FieldSchema fs) throws TableLoadingException
 

Static Protected Member Functions

static long getRowCount (Map< String, String > parameters)
 

Protected Attributes

final
org.apache.hadoop.hive.metastore.api.Table 
msTable_
 
final TableId id_
 
final Db db_
 
final String name_
 
final String owner_
 
TTableDescriptor tableDesc_
 
List< FieldSchema > fields_
 
TAccessLevel accessLevel_ = TAccessLevel.READ_WRITE
 
int numClusteringCols_
 
long numRows_ = -1
 
final ArrayType type_ = new ArrayType(new StructType())
 
long lastDdlTime_
 

Static Protected Attributes

static EnumSet< TableType > SUPPORTED_TABLE_TYPES
 

Private Member Functions

void init () throws TableLoadingException
 

Private Attributes

String originalViewDef_
 
String inlineViewDef_
 
QueryStmt queryStmt_
 
final boolean isLocalView_
 

Detailed Description

Table metadata representing a catalog view or a local view from a WITH clause. Most methods inherited from Table are not supposed to be called on this class because views are substituted with their underlying definition during analysis of a statement.

Refreshing or invalidating a view will reload the view's definition but will not affect the metadata of the underlying tables (if any).

Definition at line 41 of file View.java.

Constructor & Destructor Documentation

com.cloudera.impala.catalog.View.View ( TableId  id,
org.apache.hadoop.hive.metastore.api.Table  msTable,
Db  db,
String  name,
String  owner 
)
inline

Definition at line 67 of file View.java.

References com.cloudera.impala.catalog.View.isLocalView_.

com.cloudera.impala.catalog.View.View ( String  alias,
QueryStmt  queryStmt 
)
inline

C'tor for WITH-clause views that already have a parsed QueryStmt.

Definition at line 76 of file View.java.

References com.cloudera.impala.catalog.View.isLocalView_, and com.cloudera.impala.catalog.View.queryStmt_.

Member Function Documentation

void com.cloudera.impala.catalog.Table.clearColumns ( )
inlineinherited
static Table com.cloudera.impala.catalog.Table.fromMetastoreTable ( TableId  id,
Db  db,
org.apache.hadoop.hive.metastore.api.Table  msTbl 
)
inlinestaticinherited

Creates a table of the appropriate type based on the given hive.metastore.api.Table object.

Definition at line 207 of file Table.java.

References com.cloudera.impala.catalog.DataSourceTable.isDataSourceTable(), com.cloudera.impala.catalog.HBaseTable.isHBaseTable(), and com.cloudera.impala.catalog.HdfsFileFormat.isHdfsFormatClass().

static Table com.cloudera.impala.catalog.Table.fromThrift ( Db  parentDb,
TTable  thriftTable 
) throws TableLoadingException
inlinestaticinherited

Factory method that creates a new Table from its Thrift representation. Determines the type of table to create based on the Thrift table provided.

Definition at line 231 of file Table.java.

TCatalogObjectType com.cloudera.impala.catalog.View.getCatalogObjectType ( )
inline

Implements com.cloudera.impala.catalog.CatalogObject.

Definition at line 144 of file View.java.

Column com.cloudera.impala.catalog.Table.getColumn ( String  name)
inlineinherited
List<String> com.cloudera.impala.catalog.Table.getColumnNamesWithHmsStats ( )
inlineprotectedinherited
ArrayList<Column> com.cloudera.impala.catalog.Table.getColumnsInHiveOrder ( )
inlineinherited

Returns the list of all columns, but with partition columns at the end of the list rather than the beginning. This is equivalent to the order in which Hive enumerates columns.

Definition at line 373 of file Table.java.

References com.cloudera.impala.catalog.Table.colsByPos_, com.cloudera.impala.catalog.Table.getNonClusteringColumns(), and com.cloudera.impala.catalog.Table.numClusteringCols_.

Referenced by com.cloudera.impala.service.DescribeResultFactory.describeTableMinimal(), com.cloudera.impala.service.Frontend.getColumnStats(), and com.cloudera.impala.analysis.InsertStmt.prepareExpressions().

TableId com.cloudera.impala.catalog.Table.getId ( )
inlineinherited
String com.cloudera.impala.catalog.View.getInlineViewDef ( )
inline

Definition at line 147 of file View.java.

References com.cloudera.impala.catalog.View.inlineViewDef_.

List<Column> com.cloudera.impala.catalog.Table.getNonClusteringColumns ( )
inlineinherited

Returns the list of all columns excluding any partition columns.

Definition at line 385 of file Table.java.

References com.cloudera.impala.catalog.Table.numClusteringCols_.

Referenced by com.cloudera.impala.analysis.ComputeStatsStmt.analyze(), and com.cloudera.impala.catalog.Table.getColumnsInHiveOrder().

int com.cloudera.impala.catalog.View.getNumNodes ( )
inline

Definition at line 150 of file View.java.

long com.cloudera.impala.catalog.Table.getNumRows ( )
inlineinherited
String com.cloudera.impala.catalog.View.getOriginalViewDef ( )
inline

Definition at line 146 of file View.java.

References com.cloudera.impala.catalog.View.originalViewDef_.

String com.cloudera.impala.catalog.Table.getOwner ( )
inlineinherited

Definition at line 348 of file Table.java.

References com.cloudera.impala.catalog.Table.owner_.

QueryStmt com.cloudera.impala.catalog.View.getQueryStmt ( )
inline

Definition at line 145 of file View.java.

References com.cloudera.impala.catalog.View.queryStmt_.

static long com.cloudera.impala.catalog.Table.getRowCount ( Map< String, String >  parameters)
inlinestaticprotectedinherited
String com.cloudera.impala.catalog.Table.getStorageHandlerClassName ( )
inlineinherited

Subclasses should override this if they provide a storage handler class. Currently only HBase tables need to provide a storage handler.

Definition at line 366 of file Table.java.

ArrayType com.cloudera.impala.catalog.Table.getType ( )
inlineinherited
void com.cloudera.impala.catalog.View.init ( ) throws TableLoadingException
inlineprivate

Initializes the originalViewDef_, inlineViewDef_, and queryStmt_ members by parsing the expanded view definition SQL-string. Throws a TableLoadingException if there was any error parsing the the SQL or if the view definition did not parse into a QueryStmt.

Definition at line 117 of file View.java.

References com.cloudera.impala.catalog.Table.db_, com.cloudera.impala.catalog.Table.getMetaStoreTable(), com.cloudera.impala.catalog.Db.getName(), com.cloudera.impala.catalog.View.inlineViewDef_, com.cloudera.impala.catalog.Table.name_, com.cloudera.impala.catalog.View.originalViewDef_, gen_ir_descriptions.parser, and com.cloudera.impala.catalog.View.queryStmt_.

Referenced by com.cloudera.impala.catalog.View.load(), and com.cloudera.impala.catalog.View.loadFromThrift().

boolean com.cloudera.impala.catalog.View.isLocalView ( )
inline
void com.cloudera.impala.catalog.View.load ( Table  oldValue,
HiveMetaStoreClient  client,
org.apache.hadoop.hive.metastore.api.Table  msTbl 
) throws TableLoadingException
inline
void com.cloudera.impala.catalog.Table.loadAllColumnStats ( HiveMetaStoreClient  client)
inlineprotectedinherited
void com.cloudera.impala.catalog.View.loadFromThrift ( TTable  t) throws TableLoadingException
inlineprotected

Definition at line 106 of file View.java.

References com.cloudera.impala.catalog.View.init().

Type com.cloudera.impala.catalog.Table.parseColumnType ( FieldSchema  fs) throws TableLoadingException
inlineprotectedinherited

Gets the ColumnType from the given FieldSchema by using Impala's SqlParser. Throws a TableLoadingException if the FieldSchema could not be parsed. The type can either be:

  • Supported by Impala, in which case the type is returned.
  • A type Impala understands but is not yet implemented (e.g. date), the type is returned but type.IsSupported() returns false.
  • A type Impala can't understand at all, and a TableLoadingException is thrown.

Definition at line 331 of file Table.java.

References com.cloudera.impala.catalog.Table.getName().

Referenced by com.cloudera.impala.catalog.View.load(), com.cloudera.impala.catalog.HBaseTable.load(), com.cloudera.impala.catalog.DataSourceTable.loadColumns(), com.cloudera.impala.catalog.HdfsTable.loadColumns(), and com.cloudera.impala.catalog.HBaseTable.supportsBinaryEncoding().

void com.cloudera.impala.catalog.Table.setCatalogVersion ( long  catalogVersion)
inlineinherited
TCatalogObject com.cloudera.impala.catalog.Table.toTCatalogObject ( )
inlineinherited
TTable com.cloudera.impala.catalog.View.toThrift ( )
inline

Definition at line 162 of file View.java.

TTableDescriptor com.cloudera.impala.catalog.View.toThriftDescriptor ( Set< Long >  referencedPartitions)
inline

Definition at line 157 of file View.java.

void com.cloudera.impala.catalog.Table.updateLastDdlTime ( long  ddlTime)
inlineinherited

Updates the lastDdlTime for this Table, if the new value is greater than the existing value. Does nothing if the new value is less than or equal to the existing value.

Definition at line 132 of file Table.java.

References com.cloudera.impala.catalog.Table.lastDdlTime_.

void com.cloudera.impala.catalog.Table.validate ( ) throws TableLoadingException
inlineinherited

Checks preconditions for this table to function as expected. Currently only checks that all entries in colsByName_ use lower case keys.

Definition at line 279 of file Table.java.

References com.cloudera.impala.catalog.Table.colsByName_.

Member Data Documentation

List<FieldSchema> com.cloudera.impala.catalog.Table.fields_
protectedinherited
String com.cloudera.impala.catalog.View.inlineViewDef_
private
final boolean com.cloudera.impala.catalog.View.isLocalView_
private
long com.cloudera.impala.catalog.Table.lastDdlTime_
protectedinherited
final org.apache.hadoop.hive.metastore.api.Table com.cloudera.impala.catalog.Table.msTable_
protectedinherited
String com.cloudera.impala.catalog.View.originalViewDef_
private
final String com.cloudera.impala.catalog.Table.owner_
protectedinherited
QueryStmt com.cloudera.impala.catalog.View.queryStmt_
private
EnumSet<TableType> com.cloudera.impala.catalog.Table.SUPPORTED_TABLE_TYPES
staticprotectedinherited
Initial value:
= EnumSet.of(
TableType.EXTERNAL_TABLE, TableType.MANAGED_TABLE, TableType.VIRTUAL_VIEW)

Definition at line 88 of file Table.java.

TTableDescriptor com.cloudera.impala.catalog.Table.tableDesc_
protectedinherited

Definition at line 64 of file Table.java.


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