@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); dataTimestamp = (String) getConfigParameterValue(PARAM_DATA_TIMESTAMP); if (readDataTable && hasNext) { log.debug("Querying data table {} with schema {} and where condition {}", tableName, dbc.getActiveTableSchema(), whereCondition); xmlBytes = dbc.queryDataTable(tableName, whereCondition); } }
} catch (TableSchemaMismatchException e) { log.error("Table schema mismatch: The active table schema {} specified in the CoStoSys configuration" + " file {} does not match the columns in the subset table {}: {}", dbc.getActiveTableSchema(), costosysConfig, tableName, e.getMessage()); throw new IllegalArgumentException(e);
" file {} does not match the columns in the subset table {}: {}", dbc.getActiveTableSchema(), costosysConfig, tableName, e.getMessage()); throw new IllegalArgumentException(e);
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); // Check whether a subset table name or a data table name was given. if (readDataTable) { log.debug("Reading from data table {}", tableName); dataTableDocumentIds = dbc.query(tableName, Arrays.asList(dbc.getFieldConfiguration(dbc.getActiveTableSchema()).getPrimaryKey())); hasNext = dataTableDocumentIds.hasNext(); } else { log.debug("Reading from subset table {}", tableName); hasNext = dbc.withConnectionQueryBoolean(c -> c.hasUnfetchedRows(tableName)); } }
hasNext = !dbc.withConnectionQueryBoolean(c -> c.isEmpty(tableName)); tables = new String[]{tableName}; schemas = new String[]{dbc.getActiveTableSchema()}; } else { if (batchSize == 0) joinTables = true; dbc.checkTableSchemaCompatibility(dbc.getActiveTableSchema(), additionalTableSchemas); ImmutablePair<Integer, String[]> additionalTableNumAndNames = checkAndAdjustAdditionalTables(dbc, dataTable, additionalTableNames); int numAdditionalTables = additionalTableNumAndNames.getLeft(); else System.arraycopy(additionalTableSchemas, 0, schemas, 1, additionalTableSchemas.length); schemas[0] = dbc.getActiveTableSchema(); } else { log.debug("No additional tables were given, reading data solely from table {}", dataTable); tables = new String[]{dataTable}; schemas = new String[1]; schemas[0] = dbc.getActiveTableSchema();