@Override public boolean beforeWrite( DataContext context, Table table, CsvData data) { if (!table.getName().startsWith(tablePrefix)) { Batch batch = context.getBatch(); String sourceNodeId = batch.getSourceNodeId(); table.setSchema(schemaPrefix != null ? schemaPrefix + sourceNodeId : sourceNodeId); } return true; }
table.setCatalog(attributeValue); } else if (attributeName.equalsIgnoreCase("schema")) { table.setSchema(attributeValue); } else if (attributeName.equalsIgnoreCase("dml")) { if (attributeValue.equals("I")) {
table.setSchema(schema); metaData.setSchemaPattern(schema);
} else if (format == Format.SQL) { Table targetTable = table.copy(); targetTable.setSchema(schema); targetTable.setCatalog(catalog); insertSql = DmlStatementFactory.createDmlStatement(
table.setSchema(null);
public boolean start(Table table) { /* * in the case when the target schema or catalog is set then we need to * use the previous schema or catalog to look up the table locally. */ this.currentTable = platform.getTableFromCache(table.getOldCatalog(), table.getOldSchema(), table.getName(), false); this.currentTable = currentTable.copyAndFilterColumns(table.getColumnNames(), table.getPrimaryKeyColumnNames(), true); /* * restore the schema and catalog from the passed in table because they * might have not been originally set, but were set when looking up the table locally */ this.currentTable.setSchema(table.getSchema()); this.currentTable.setCatalog(table.getCatalog()); this.currentTable.setName(table.getName()); return true; }