Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade depedencies #20405

Merged
merged 6 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ public static ColumnMapping objectMapping(
return new ColumnMapping(trinoType, readFunction, writeFunction, predicatePushdownController);
}

public static ColumnMapping mapping(
Type trinoType,
ReadFunction readFunction,
WriteFunction writeFunction,
PredicatePushdownController predicatePushdownController)
{
return new ColumnMapping(trinoType, readFunction, writeFunction, predicatePushdownController);
}

private final Type type;
private final ReadFunction readFunction;
private final WriteFunction writeFunction;
Expand Down
2 changes: 1 addition & 1 deletion plugin/trino-redshift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>com.amazon.redshift</groupId>
<artifactId>redshift-jdbc42</artifactId>
<version>2.1.0.24</version>
<version>2.1.0.25</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion plugin/trino-singlestore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>com.singlestore</groupId>
<artifactId>singlestore-jdbc-client</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import io.airlift.slice.Slice;
import io.trino.plugin.base.expression.ConnectorExpressionRewriter;
import io.trino.plugin.base.mapping.IdentifierMapping;
import io.trino.plugin.jdbc.BaseJdbcClient;
Expand All @@ -31,6 +32,7 @@
import io.trino.plugin.jdbc.PreparedQuery;
import io.trino.plugin.jdbc.QueryBuilder;
import io.trino.plugin.jdbc.RemoteTableName;
import io.trino.plugin.jdbc.SliceReadFunction;
import io.trino.plugin.jdbc.WriteMapping;
import io.trino.plugin.jdbc.expression.JdbcConnectorExpressionRewriterBuilder;
import io.trino.plugin.jdbc.expression.ParameterizedExpression;
Expand Down Expand Up @@ -308,7 +310,7 @@ public Optional<ColumnMapping> toColumnMapping(ConnectorSession session, Connect
return Optional.of(defaultCharColumnMapping(typeHandle.getRequiredColumnSize(), false));
case Types.VARCHAR:
case Types.LONGVARCHAR:
return Optional.of(defaultVarcharColumnMapping(typeHandle.getRequiredColumnSize(), false));
return Optional.of(checkNullUsingBytes(defaultVarcharColumnMapping(typeHandle.getRequiredColumnSize(), false)));
case Types.DECIMAL:
int precision = typeHandle.getRequiredColumnSize();
int decimalDigits = typeHandle.getRequiredDecimalDigits();
Expand All @@ -323,7 +325,7 @@ public Optional<ColumnMapping> toColumnMapping(ConnectorSession session, Connect
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
return Optional.of(varbinaryColumnMapping());
return Optional.of(checkNullUsingBytes(varbinaryColumnMapping()));
case Types.DATE:
return Optional.of(ColumnMapping.longMapping(
DATE,
Expand All @@ -347,6 +349,32 @@ public Optional<ColumnMapping> toColumnMapping(ConnectorSession session, Connect
return Optional.empty();
}

private static ColumnMapping checkNullUsingBytes(ColumnMapping mapping)
{
if (mapping.getReadFunction() instanceof SliceReadFunction sliceReadFunction) {
SliceReadFunction wrapper = new SliceReadFunction() {
@Override
public Slice readSlice(ResultSet resultSet, int columnIndex)
throws SQLException
{
return sliceReadFunction.readSlice(resultSet, columnIndex);
}

@Override
public boolean isNull(ResultSet resultSet, int columnIndex)
throws SQLException
{
// Singlestore driver 1.2.1 will throw an exception if blob backed columns are read using getObject()
resultSet.getBytes(columnIndex);
return resultSet.wasNull();
}
};

return ColumnMapping.mapping(mapping.getType(), wrapper, mapping.getWriteFunction(), mapping.getPredicatePushdownController());
}
return mapping;
}

private static int getTimePrecision(int timeColumnSize)
{
if (timeColumnSize == ZERO_PRECISION_TIME_COLUMN_SIZE) {
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@
<dep.antlr.version>4.13.1</dep.antlr.version>
<dep.arrow.version>14.0.2</dep.arrow.version>
<dep.avro.version>1.11.3</dep.avro.version>
<dep.aws-sdk.version>1.12.636</dep.aws-sdk.version>
<dep.aws-sdk.version>1.12.638</dep.aws-sdk.version>
<dep.cassandra.version>4.17.0</dep.cassandra.version>
<dep.confluent.version>7.5.1</dep.confluent.version>
<dep.docker.images.version>87</dep.docker.images.version>
<dep.drift.version>1.21</dep.drift.version>
<dep.duct-tape.version>1.0.8</dep.duct-tape.version>
<dep.errorprone.version>2.23.0</dep.errorprone.version>
<dep.flyway.version>10.5.0</dep.flyway.version>
<dep.flyway.version>10.6.0</dep.flyway.version>
<dep.google.http.client.version>1.43.3</dep.google.http.client.version>
<dep.iceberg.version>1.4.3</dep.iceberg.version>
<dep.jna.version>5.14.0</dep.jna.version>
Expand Down Expand Up @@ -218,7 +218,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.29.0</version>
<version>26.30.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -298,7 +298,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.23.2</version>
<version>2.23.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Loading