use of com.google.api.services.datastream.v1alpha1.model.OracleColumn in project DataflowTemplates by GoogleCloudPlatform.
the class DataStreamClient method getOraclePrimaryKeys.
public List<String> getOraclePrimaryKeys(String streamName, String schemaName, String tableName, SourceConfig sourceConnProfile) throws IOException {
List<String> primaryKeys = new ArrayList<String>();
OracleTable table = discoverOracleTableSchema(streamName, schemaName, tableName, sourceConnProfile);
for (OracleColumn column : table.getOracleColumns()) {
Boolean isPrimaryKey = column.getPrimaryKey();
if (BooleanUtils.isTrue(isPrimaryKey)) {
primaryKeys.add(column.getColumnName());
}
}
return primaryKeys;
}
use of com.google.api.services.datastream.v1alpha1.model.OracleColumn in project DataflowTemplates by GoogleCloudPlatform.
the class DataStreamClient method getOracleObjectSchema.
private Map<String, StandardSQLTypeName> getOracleObjectSchema(String streamName, String schemaName, String tableName, SourceConfig sourceConnProfile) throws IOException {
Map<String, StandardSQLTypeName> objectSchema = new HashMap<String, StandardSQLTypeName>();
OracleTable table = discoverOracleTableSchema(streamName, schemaName, tableName, sourceConnProfile);
for (OracleColumn column : table.getOracleColumns()) {
StandardSQLTypeName bqType = convertOracleToBigQueryColumnType(column);
objectSchema.put(column.getColumnName(), bqType);
}
return objectSchema;
}
Aggregations