1
0
mirror of synced 2025-12-25 02:09:19 -05:00

JDBC Sources: remove redundant date-time datatypes formatting (#20760)

* JDBC sources: consolidate date/time values mapping

* fixed Snowflake acceptance tests

* fixed TestJdbcUtils

* refactoring

* update setDate for incremental sync

* fixed CockroachDbJdbcSourceAcceptanceTest

* fixed CockroachDbSourceDatatypeTest

* fixed CockroachDbSourceDatatypeTest

* fixed MsSQLSourceDatatypeTest

* fixed MsSQL cdc datatype test

* refactoring

* fixed mssql cdc test

* fixed Redshift tests

* fixed Redshift tests

* updated db2 datatype tests

* fixed DB2 tests

* fixed DB2 strict-encrypt tests

* fixed Oracle strict-encrypt tests

* refactoring

* updated changelog

* refactoring

* removed redundant overrides

* bump versions

* auto-bump connector version

* JDBC Sources: remove redundant date parsing

* updated Snowflake test

* updated cockroachdb test

* updated date-time datatypes parsing in Postgres Source

* updated formatting in JDBC sources

* updated test cases

* updated Snowflake test

* updated Snowflake, Redshift, Cockroach, DB2 tests

* updated Snowflake, Postgres tests

* updated Redshift tests

* updated MySQL, MsSQL, DB2 tests

* updated MsSQL tests

* updated Oracle tests

* updated Oracle tests

* updated Oracle tests

* fixed some tests

* refactoring

* fixed checkstyle

* fixed TestJdbcUtils

* randomize Reshift test username

* removed redundant test

* updated sanity test

* Automated Change

* format time and bump versions

* auto-bump connector version

* bump versions

* auto-bump connector version

* auto-bump connector version

* manually update definitions

* Automated Change

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Co-authored-by: ievgeniit <etsybaev@gmail.com>
Co-authored-by: VitaliiMaltsev <VitaliiMaltsev@users.noreply.github.com>
This commit is contained in:
VitaliiMaltsev
2023-03-23 16:31:50 +02:00
committed by GitHub
parent 69736d9f40
commit 12eac421de
55 changed files with 209 additions and 324 deletions

View File

@@ -16,5 +16,5 @@ ENV APPLICATION source-mssql
COPY --from=build /airbyte /airbyte
LABEL io.airbyte.version=1.0.5
LABEL io.airbyte.version=1.0.6
LABEL io.airbyte.name=airbyte/source-mssql

View File

@@ -15,7 +15,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.microsoft.sqlserver.jdbc.Geography;
import com.microsoft.sqlserver.jdbc.Geometry;
import com.microsoft.sqlserver.jdbc.SQLServerResultSetMetaData;
import io.airbyte.db.DataTypeUtils;
import io.airbyte.db.jdbc.JdbcSourceOperations;
import java.nio.charset.Charset;
import java.sql.JDBCType;
@@ -111,11 +110,6 @@ public class MssqlSourceOperations extends JdbcSourceOperations {
node.put(columnName, value);
}
@Override
protected void putTime(final ObjectNode node, final String columnName, final ResultSet resultSet, final int index) throws SQLException {
node.put(columnName, DataTypeUtils.toISOTimeString(resultSet.getTimestamp(index).toLocalDateTime()));
}
protected void putGeometry(final ObjectNode node,
final String columnName,
final ResultSet resultSet,

View File

@@ -153,7 +153,7 @@ public abstract class AbstractMssqlSourceDatatypeTest extends AbstractSourceData
.sourceType("smalldatetime")
.airbyteType(JsonSchemaType.STRING)
.addInsertValues("'1900-01-01'", "'2079-06-06'", "null")
.addExpectedValues("1900-01-01T00:00:00.000000Z", "2079-06-06T00:00:00.000000Z", null)
.addExpectedValues("1900-01-01T00:00:00.000000", "2079-06-06T00:00:00.000000", null)
.createTablePatternSql(CREATE_TABLE_SQL)
.build());
@@ -161,10 +161,10 @@ public abstract class AbstractMssqlSourceDatatypeTest extends AbstractSourceData
TestDataHolder.builder()
.sourceType("datetime")
.airbyteType(JsonSchemaType.STRING)
.addInsertValues("'1753-01-01'", "'9999-12-31'", "'9999-12-31T13:00:04Z'",
"'9999-12-31T13:00:04.123Z'", "null")
.addExpectedValues("1753-01-01T00:00:00.000000Z", "9999-12-31T00:00:00.000000Z", "9999-12-31T13:00:04.000000Z",
"9999-12-31T13:00:04.123000Z", null)
.addInsertValues("'1753-01-01'", "'9999-12-31'", "'9999-12-31T13:00:04'",
"'9999-12-31T13:00:04.123'", "null")
.addExpectedValues("1753-01-01T00:00:00.000000", "9999-12-31T00:00:00.000000", "9999-12-31T13:00:04",
"9999-12-31T13:00:04.123", null)
.createTablePatternSql(CREATE_TABLE_SQL)
.build());
@@ -172,8 +172,8 @@ public abstract class AbstractMssqlSourceDatatypeTest extends AbstractSourceData
TestDataHolder.builder()
.sourceType("datetime2")
.airbyteType(JsonSchemaType.STRING)
.addInsertValues("'0001-01-01'", "'9999-12-31'", "'9999-12-31T13:00:04.123456Z'", "null")
.addExpectedValues("0001-01-01T00:00:00.000000Z", "9999-12-31T00:00:00.000000Z", "9999-12-31T13:00:04.123456Z", null)
.addInsertValues("'0001-01-01'", "'9999-12-31'", "'9999-12-31T13:00:04.123456'", "null")
.addExpectedValues("0001-01-01T00:00:00.000000", "9999-12-31T00:00:00.000000", "9999-12-31T13:00:04.123456", null)
.createTablePatternSql(CREATE_TABLE_SQL)
.build());