public void openNewFile(int suffixId) throws IOException { Schema appenderSchema = (plan instanceof InsertNode) ? ((InsertNode) plan).getTableSchema() : outSchema; if (PlannerUtil.isFileStorageType(meta.getDataFormat())) { String prevFile = null; lastFileName = context.getOutputPath(); if (suffixId > 0) { prevFile = lastFileName.toString(); lastFileName = new Path(lastFileName + "_" + suffixId); } FileTablespace space = TablespaceManager.get(lastFileName.toUri()); appender = space.getAppender(meta, appenderSchema, lastFileName); if (suffixId > 0) { LOG.info(prevFile + " exceeds " + SessionVars.MAX_OUTPUT_FILE_SIZE.keyname() + " (" + maxPerFileSize + " MB), " + "The remain output will be written into " + lastFileName.toString()); } } else { Path stagingDir = context.getQueryContext().getStagingDir(); appender = TablespaceManager.get(stagingDir.toUri()).getAppender( context.getQueryContext(), context.getTaskId(), meta, appenderSchema, stagingDir); } appender.enableStats(); appender.init(); }
public void openNewFile(int suffixId) throws IOException { Schema appenderSchema = (plan instanceof InsertNode) ? ((InsertNode) plan).getTableSchema() : outSchema; if (PlannerUtil.isFileStorageType(meta.getDataFormat())) { String prevFile = null; lastFileName = context.getOutputPath(); if (suffixId > 0) { prevFile = lastFileName.toString(); lastFileName = new Path(lastFileName + "_" + suffixId); } FileTablespace space = TablespaceManager.get(lastFileName.toUri()); appender = space.getAppender(meta, appenderSchema, lastFileName); if (suffixId > 0) { LOG.info(prevFile + " exceeds " + SessionVars.MAX_OUTPUT_FILE_SIZE.keyname() + " (" + maxPerFileSize + " MB), " + "The remain output will be written into " + lastFileName.toString()); } } else { Path stagingDir = context.getQueryContext().getStagingDir(); appender = TablespaceManager.get(stagingDir.toUri()).getAppender( context.getQueryContext(), context.getTaskId(), meta, appenderSchema, stagingDir); } appender.enableStats(); appender.init(); }
private void buildProjectedInsert(PlanContext context, InsertNode insertNode) { Schema tableSchema = insertNode.getTableSchema(); Schema targetColumns = insertNode.getTargetSchema();
private static TableDesc createTableDesc(InsertNode insertNode) { TableMeta meta = new TableMeta(insertNode.getStorageType(), insertNode.getOptions()); TableDesc tableDescTobeCreated = new TableDesc( insertNode.getTableName(), insertNode.getTableSchema(), meta, insertNode.getUri() != null ? insertNode.getUri() : null); if (insertNode.hasPartition()) { tableDescTobeCreated.setPartitionMethod(insertNode.getPartitionMethod()); } return tableDescTobeCreated; }
private static TableDesc createTableDesc(InsertNode insertNode) { TableMeta meta = new TableMeta(insertNode.getStorageType(), insertNode.getOptions()); TableDesc tableDescTobeCreated = new TableDesc( insertNode.getTableName(), insertNode.getTableSchema(), meta, insertNode.getUri() != null ? insertNode.getUri() : null); if (insertNode.hasPartition()) { tableDescTobeCreated.setPartitionMethod(insertNode.getPartitionMethod()); } return tableDescTobeCreated; }
private void buildProjectedInsert(PlanContext context, InsertNode insertNode) { Schema tableSchema = insertNode.getTableSchema(); Schema targetColumns = insertNode.getTargetSchema();
for (int i = 0; i < partitionKeyColumns.length; i++) { for (Column column : partitionKeyColumns) { int id = insertNode.getTableSchema().getColumnId(column.getQualifiedName()); sortSpecs[i++] = new SortSpec(insertNode.getProjectedSchema().getColumn(id), true, false);
for (int i = 0; i < partitionKeyColumns.length; i++) { for (Column column : partitionKeyColumns) { int id = insertNode.getTableSchema().getColumnId(column.getQualifiedName()); sortSpecs[i++] = new SortSpec(insertNode.getProjectedSchema().getColumn(id), true, false);
Schema tableSchema = null, projectedSchema = null; if (node.getType() == NodeType.INSERT) { tableSchema = ((InsertNode) node).getTableSchema(); projectedSchema = ((InsertNode) node).getProjectedSchema(); } else {
Schema tableSchema = null, projectedSchema = null; if (node.getType() == NodeType.INSERT) { tableSchema = ((InsertNode) node).getTableSchema(); projectedSchema = ((InsertNode) node).getProjectedSchema(); } else {
int idx = insertNode.getTableSchema().getColumnId(column.getQualifiedName()); keyIds[i] = idx; } else if (this.plan.getType() == NodeType.CREATE_TABLE) {
int idx = insertNode.getTableSchema().getColumnId(column.getQualifiedName()); keyIds[i] = idx; } else if (this.plan.getType() == NodeType.CREATE_TABLE) {