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

Public Member Functions

ImpalaException getCause ()
 
boolean isLoaded ()
 
TCatalogObjectType getCatalogObjectType ()
 
int getNumNodes ()
 
TTableDescriptor toThriftDescriptor (Set< Long > referencedPartitions)
 
void load (Table oldValue, HiveMetaStoreClient client, org.apache.hadoop.hive.metastore.api.Table msTbl) throws TableLoadingException
 
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)
 

Static Public Member Functions

static IncompleteTable createUninitializedTable (TableId id, Db db, String name)
 
static IncompleteTable createFailedMetadataLoadTable (TableId id, Db db, String name, ImpalaException e)
 
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 thriftTable) 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

 IncompleteTable (TableId id, Db db, String name, ImpalaException cause)
 

Private Attributes

ImpalaException cause_
 

Detailed Description

Represents a table with incomplete metadata. The metadata may be incomplete because it has not yet been loaded or because of errors encountered during the loading process.

Definition at line 37 of file IncompleteTable.java.

Constructor & Destructor Documentation

com.cloudera.impala.catalog.IncompleteTable.IncompleteTable ( TableId  id,
Db  db,
String  name,
ImpalaException  cause 
)
inlineprivate

Member Function Documentation

void com.cloudera.impala.catalog.Table.clearColumns ( )
inlineinherited
static IncompleteTable com.cloudera.impala.catalog.IncompleteTable.createFailedMetadataLoadTable ( TableId  id,
Db  db,
String  name,
ImpalaException  e 
)
inlinestatic
static IncompleteTable com.cloudera.impala.catalog.IncompleteTable.createUninitializedTable ( TableId  id,
Db  db,
String  name 
)
inlinestatic
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.IncompleteTable.getCatalogObjectType ( )
inline

Implements com.cloudera.impala.catalog.CatalogObject.

Definition at line 62 of file IncompleteTable.java.

ImpalaException com.cloudera.impala.catalog.IncompleteTable.getCause ( )
inline

Returns the cause (ImpalaException) which led to this table's metadata being incomplete.

Definition at line 53 of file IncompleteTable.java.

References com.cloudera.impala.catalog.IncompleteTable.cause_.

Referenced by com.cloudera.impala.catalog.CatalogTest.testLoadingUnsupportedTableTypes().

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
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.IncompleteTable.getNumNodes ( )
inline
long com.cloudera.impala.catalog.Table.getNumRows ( )
inlineinherited
String com.cloudera.impala.catalog.Table.getOwner ( )
inlineinherited

Definition at line 348 of file Table.java.

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

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
boolean com.cloudera.impala.catalog.IncompleteTable.isLoaded ( )
inline

See comment on cause_.

Implements com.cloudera.impala.catalog.CatalogObject.

Definition at line 59 of file IncompleteTable.java.

References com.cloudera.impala.catalog.IncompleteTable.cause_.

void com.cloudera.impala.catalog.IncompleteTable.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.IncompleteTable.loadFromThrift ( TTable  thriftTable) throws TableLoadingException
inlineprotected

Definition at line 95 of file IncompleteTable.java.

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
TTableDescriptor com.cloudera.impala.catalog.IncompleteTable.toThriftDescriptor ( Set< Long >  referencedPartitions)
inline
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
long com.cloudera.impala.catalog.Table.lastDdlTime_
protectedinherited
final org.apache.hadoop.hive.metastore.api.Table com.cloudera.impala.catalog.Table.msTable_
protectedinherited
final String com.cloudera.impala.catalog.Table.owner_
protectedinherited
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: