@Override public boolean equals(Object obj) { return obj instanceof RelOptTableImpl && this.rowType.equals(((RelOptTableImpl) obj).getRowType()) && this.table == ((RelOptTableImpl) obj).table; }
@Override public boolean equals(Object obj) { return obj instanceof RelOptTableImpl && this.rowType.equals(((RelOptTableImpl) obj).getRowType()) && this.table == ((RelOptTableImpl) obj).table; }
public RelOptTable copyOf(RelOptTable table) { if (table instanceof RelOptTableWrapper) { final RelOptTableWrapper wrapper = (RelOptTableWrapper) table; return new RelOptTableWrapper( wrapper.getQualifiedName(), copyOf(wrapper.getRelOptTable()) ); } else if (table instanceof RelOptTableImpl) { final RelOptTableImpl impl = (RelOptTableImpl) table; return impl.copy(copyOf(impl.getRowType())); // this won't copy the RelOptSchema } notSupported(table); return table; }
public RelNode toRel(ToRelContext context) { if (this.getRowType().isDynamicStruct()) { final RelDataType staticRowType = new RelRecordType(getRowType().getFieldList()); final RelOptTable relOptTable = this.copy(staticRowType); return relOptTable.toRel(context);
public RelNode toRel(ToRelContext context) { if (this.getRowType().isDynamicStruct()) { final RelDataType staticRowType = new RelRecordType(getRowType().getFieldList()); final RelOptTable relOptTable = this.copy(staticRowType); return relOptTable.toRel(context);
private TableScan createNewTableScanFromSelection(EnumerableTableScan oldScan, List<String> newFiles, String cacheFileRoot, boolean wasAllPartitionsPruned, MetadataContext metaContext) { final RelOptTableImpl t = (RelOptTableImpl) oldScan.getTable(); final FormatSelection formatSelection = (FormatSelection) table.getSelection(); final FileSelection newFileSelection = new FileSelection(null, newFiles, getBaseTableLocation(), cacheFileRoot, wasAllPartitionsPruned, formatSelection.getSelection().getDirStatus()); newFileSelection.setMetaContext(metaContext); final FormatSelection newFormatSelection = new FormatSelection(formatSelection.getFormat(), newFileSelection); final DrillTranslatableTable newTable = new DrillTranslatableTable( new DynamicDrillTable(table.getPlugin(), table.getStorageEngineName(), table.getUserName(), newFormatSelection)); final RelOptTableImpl newOptTableImpl = RelOptTableImpl.create(t.getRelOptSchema(), t.getRowType(), newTable, GuavaUtils.convertToUnshadedImmutableList(ImmutableList.of())); // return an EnumerableTableScan with fileSelection being part of digest of TableScan node. return DirPrunedEnumerableTableScan.create(oldScan.getCluster(), newOptTableImpl, newFileSelection.toString()); }