Skip to content

Commit

Permalink
fix redshift sqlgenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
edgao committed Jan 3, 2024
1 parent 4d045ca commit 3c53c37
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected Field<?> castedField(final Field<?> field, final AirbyteType type, fin
}

@Override
protected List<Field<?>> extractRawDataFields(LinkedHashMap<ColumnId, AirbyteType> columns) {
protected List<Field<?>> extractRawDataFields(final LinkedHashMap<ColumnId, AirbyteType> columns, final boolean useExpensiveSaferCasting) {
return columns
.entrySet()
.stream()
Expand All @@ -157,7 +157,7 @@ private Field<String> jsonSerialize(final Field<?> field) {
* @param arrays
* @return
*/
Field<?> arrayConcatStmt(List<Field<?>> arrays) {
Field<?> arrayConcatStmt(final List<Field<?>> arrays) {
if (arrays.isEmpty()) {
return field("ARRAY()"); // Return an empty string if the list is empty
}
Expand All @@ -168,8 +168,8 @@ Field<?> arrayConcatStmt(List<Field<?>> arrays) {
}

// Recursive case: construct ARRAY_CONCAT function call
Field<?> lastValue = arrays.get(arrays.size() - 1);
Field<?> recursiveCall = arrayConcatStmt(arrays.subList(0, arrays.size() - 1));
final Field<?> lastValue = arrays.get(arrays.size() - 1);
final Field<?> recursiveCall = arrayConcatStmt(arrays.subList(0, arrays.size() - 1));

return function("ARRAY_CONCAT", getSuperType(), recursiveCall, lastValue);
}
Expand Down Expand Up @@ -227,7 +227,7 @@ public boolean existingSchemaMatchesStreamConfig(final StreamConfig stream, fina
* @return
*/
@Override
protected Field<Integer> getRowNumber(List<ColumnId> primaryKeys, Optional<ColumnId> cursor) {
protected Field<Integer> getRowNumber(final List<ColumnId> primaryKeys, final Optional<ColumnId> cursor) {
final List<Field<?>> primaryKeyFields =
primaryKeys != null ? primaryKeys.stream().map(columnId -> field(quotedName(columnId.name()))).collect(Collectors.toList())
: new ArrayList<>();
Expand Down Expand Up @@ -255,7 +255,7 @@ protected Field<Timestamp> currentTimestamp() {
}

@Override
public boolean shouldRetry(Exception e) {
public boolean shouldRetry(final Exception e) {
return false;
}

Expand Down

0 comments on commit 3c53c37

Please sign in to comment.