static boolean describeSchemaByItself(RelationNode relationNode) { if (relationNode instanceof ScanNode && ((ScanNode) relationNode).getTableDesc().hasEmptySchema()) { return true; } return false; }
static boolean describeSchemaByItself(RelationNode relationNode) { if (relationNode instanceof ScanNode && ((ScanNode) relationNode).getTableDesc().hasEmptySchema()) { return true; } return false; }
@Override public void rescan() throws IOException { cachedData.clear(); cachedData.addAll(fetchSystemTable(scanNode.getTableDesc(), inSchema)); tableStats = new TableStats(); tableStats.setNumRows(cachedData.size()); }
@Override public void rescan() throws IOException { cachedData.clear(); cachedData.addAll(fetchSystemTable(scanNode.getTableDesc(), inSchema)); tableStats = new TableStats(); tableStats.setNumRows(cachedData.size()); }
public String toString() { StringBuilder sb = new StringBuilder("Scan (table=").append(getTableName()); if (hasAlias()) { sb.append(", alias=").append(alias); } if (hasQual()) { sb.append(", filter=").append(qual); } sb.append(", path=").append(getTableDesc().getUri()).append(")"); return sb.toString(); }
private void updateDescsForScanNodes(NodeType nodeType) { assert nodeType == NodeType.SCAN || nodeType == NodeType.PARTITIONS_SCAN || nodeType == NodeType.INDEX_SCAN; LogicalNode[] scanNodes = PlannerUtil.findAllNodes(plan, nodeType); if (scanNodes != null) { for (LogicalNode node : scanNodes) { ScanNode scanNode = (ScanNode) node; descs.put(scanNode.getCanonicalName(), scanNode.getTableDesc()); } } }
private void updateDescsForScanNodes(NodeType nodeType) { assert nodeType == NodeType.SCAN || nodeType == NodeType.PARTITIONS_SCAN || nodeType == NodeType.INDEX_SCAN; LogicalNode[] scanNodes = PlannerUtil.findAllNodes(plan, nodeType); if (scanNodes != null) { for (LogicalNode node : scanNodes) { ScanNode scanNode = (ScanNode) node; descs.put(scanNode.getCanonicalName(), scanNode.getTableDesc()); } } }
public String toString() { StringBuilder sb = new StringBuilder(capitalize(getType().name()) + " (table=").append(getTableName()); if (hasAlias()) { sb.append(", alias=").append(alias); } if (hasQual()) { sb.append(", filter=").append(qual); } sb.append(", path=").append(getTableDesc().getUri()).append(")"); return sb.toString(); }
public NonForwardQueryResultFileScanner(TajoConf tajoConf, String sessionId, QueryId queryId, ScanNode scanNode, int maxRow, CodecType codecType) throws IOException { this.tajoConf = tajoConf; this.sessionId = sessionId; this.queryId = queryId; this.scanNode = scanNode; this.tableDesc = scanNode.getTableDesc(); this.maxRow = maxRow; this.rowEncoder = RowStoreUtil.createEncoder(scanNode.getOutSchema()); this.codecType = codecType; }
public NonForwardQueryResultFileScanner(AsyncTaskService asyncTaskService, TajoConf tajoConf, String sessionId, QueryId queryId, ScanNode scanNode, int maxRow, Optional<CodecType> codecType) throws IOException { this.asyncTaskService = asyncTaskService; this.tajoConf = tajoConf; this.sessionId = sessionId; this.queryId = queryId; this.scanNode = scanNode; this.tableDesc = scanNode.getTableDesc(); this.maxRow = maxRow; this.rowEncoder = RowStoreUtil.createEncoder(scanNode.getOutSchema()); this.codecType = codecType; }
public ExternalSortExec(final TaskAttemptContext context,final SortNode plan, final ScanNode scanNode, final CatalogProtos.FragmentProto[] fragments) throws PhysicalPlanningException { this(context, plan); mergedInputFragments = new ArrayList<>(); for (CatalogProtos.FragmentProto proto : fragments) { FileFragment fragment = FragmentConvertor.convert(context.getConf(), proto); mergedInputFragments.add(new Chunk(inSchema, fragment, scanNode.getTableDesc().getMeta())); } }
public ExternalSortExec(final TaskAttemptContext context,final SortNode plan, final ScanNode scanNode, final CatalogProtos.FragmentProto[] fragments) throws PhysicalPlanningException { this(context, plan); mergedInputFragments = TUtil.newList(); for (CatalogProtos.FragmentProto proto : fragments) { FileFragment fragment = FragmentConvertor.convert(FileFragment.class, proto); mergedInputFragments.add(new Chunk(inSchema, fragment, scanNode.getTableDesc().getMeta())); } }
/** * It sets default table properties affected by system global configuration * The table property are implicitly used to read Table rows. * * @param context QueryContext * @param node ScanNode */ public static void setTableProperty(OverridableConf context, ScanNode node) { TableMeta meta = node.getTableDesc().getMeta(); // set default time zone, if there is no table timezone setProperty(context.getConf(), TajoConf.ConfVars.$TIMEZONE, meta, StorageConstants.TIMEZONE); }
/** * It sets default table properties affected by system global configuration * The table property are implicitly used to read Table rows. * * @param context QueryContext * @param node ScanNode */ public static void setTableProperty(OverridableConf context, ScanNode node) { TableMeta meta = node.getTableDesc().getMeta(); // set default time zone, if there is no table timezone setProperty(context.getConf(), TajoConf.ConfVars.$TIMEZONE, meta, StorageConstants.TIMEZONE); }
public SeqScanExec(TaskAttemptContext context, ScanNode plan, CatalogProtos.FragmentProto [] fragments) throws IOException { super(context, plan.getInSchema(), plan.getOutSchema()); this.plan = plan; this.qual = plan.getQual(); this.fragments = fragments; if (plan.getTableDesc().hasPartition() && plan.getTableDesc().getPartitionMethod().getPartitionType() == CatalogProtos.PartitionType.COLUMN) { rewriteColumnPartitionedTableSchema(); } }
public SeqScanExec(TaskAttemptContext context, ScanNode plan, CatalogProtos.FragmentProto [] fragments) throws IOException { super(context, plan.getInSchema(), plan.getOutSchema()); this.plan = plan; this.qual = plan.getQual(); this.fragments = fragments; if (plan.getTableDesc().hasPartition() && plan.getTableDesc().getPartitionMethod().getPartitionType() == CatalogProtos.PartitionType.COLUMN) { rewriteColumnPartitionedTableSchema(); } }
@Override public boolean isEligible(LogicalPlanRewriteRuleContext context) { for (LogicalPlan.QueryBlock block : context.getPlan().getQueryBlocks()) { for (RelationNode relation : block.getRelations()) { if (relation.getType() == NodeType.SCAN) { TableDesc table = ((ScanNode)relation).getTableDesc(); if (table.hasPartition()) { return true; } } } } return false; }
@Override public boolean isEligible(LogicalPlanRewriteRuleContext context) { for (LogicalPlan.QueryBlock block : context.getPlan().getQueryBlocks()) { for (RelationNode relation : block.getRelations()) { if (relation.getType() == NodeType.SCAN) { TableDesc table = ((ScanNode)relation).getTableDesc(); if (table.hasPartition()) { return true; } } } } return false; }
public IndexScanNode(int pid, ScanNode scanNode , Schema keySchema , SimplePredicate[] predicates, URI indexPath) { this(pid); init(scanNode.getTableDesc()); setQual(scanNode.getQual()); setInSchema(scanNode.getInSchema()); setTargets(scanNode.getTargets()); this.set(keySchema, predicates, indexPath); }
public IndexScanNode(int pid, ScanNode scanNode , Schema keySchema , SimplePredicate[] predicates, URI indexPath) { this(pid); init(scanNode.getTableDesc()); setQual(scanNode.getQual()); setInSchema(scanNode.getInSchema()); setTargets(scanNode.getTargets()); this.set(keySchema, predicates, indexPath); }