MCPcopy Create free account
hub / github.com/apache/impala / loadFromThrift

Method loadFromThrift

fe/src/main/java/org/apache/impala/catalog/Table.java:629–661  ·  view source on GitHub ↗
(TTable thriftTable)

Source from the content-addressed store, hash-verified

627 }
628
629 protected void loadFromThrift(TTable thriftTable) throws TableLoadingException {
630 List<TColumn> columns = new ArrayList<TColumn>();
631 columns.addAll(thriftTable.getClustering_columns());
632 columns.addAll(thriftTable.getColumns());
633
634 colsByPos_.clear();
635 colsByPos_.ensureCapacity(columns.size());
636 try {
637 for (int i = 0; i < columns.size(); ++i) {
638 Column col = Column.fromThrift(columns.get(i));
639 colsByPos_.add(col.getPosition(), col);
640 colsByName_.put(col.getName().toLowerCase(), col);
641 ((StructType) type_.getItemType()).addField(getStructFieldFromColumn(col));
642 }
643 virtualCols_.clear();
644 virtualCols_.ensureCapacity(thriftTable.getVirtual_columns().size());
645 for (TColumn tvCol : thriftTable.getVirtual_columns()) {
646 virtualCols_.add(VirtualColumn.fromThrift(tvCol));
647 }
648 } catch (ImpalaRuntimeException e) {
649 throw new TableLoadingException(String.format("Error loading schema for " +
650 "table '%s'", getName()), e);
651 }
652
653 numClusteringCols_ = thriftTable.getClustering_columns().size();
654 if (thriftTable.isSetTable_stats()) tableStats_ = thriftTable.getTable_stats();
655
656 // Default to READ_WRITE access if the field is not set.
657 accessLevel_ = thriftTable.isSetAccess_level() ? thriftTable.getAccess_level() :
658 TAccessLevel.READ_WRITE;
659
660 storageMetadataLoadTime_ = thriftTable.getStorage_metadata_load_time_ns();
661 }
662
663 /**
664 * If column is 'IcebergColumn', we return 'IcebergStructField', otherwise, we

Callers 1

fromThriftMethod · 0.95

Calls 15

fromThriftMethod · 0.95
getPositionMethod · 0.95
getNameMethod · 0.95
fromThriftMethod · 0.95
getNameMethod · 0.95
addAllMethod · 0.80
ensureCapacityMethod · 0.80
addFieldMethod · 0.80
getItemTypeMethod · 0.80
getColumnsMethod · 0.65
clearMethod · 0.65

Tested by

no test coverage detected