(TTable thriftTable)
| 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 |
no test coverage detected