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

[feature](multi-catalog) support postgresql jdbc catalog #15570

Merged
merged 6 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix 5
  • Loading branch information
BePPPower committed Jan 5, 2023
commit 17f64c808aa8f611450cc8247515037f541e77cd
8 changes: 6 additions & 2 deletions be/src/vec/exec/vjdbc_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ Status JdbcConnector::_insert_column_data(JNIEnv* env, jobject jobj, const TypeD
}
case TYPE_DATEV2: {
int64_t num = _jobject_to_date(env, jobj, true);
reinterpret_cast<vectorized::ColumnVector<vectorized::Int64>*>(col_ptr)->insert_value(num);
uint32_t num2 = static_cast<uint32_t>(num);
reinterpret_cast<vectorized::ColumnVector<vectorized::UInt32>*>(col_ptr)->insert_value(
num2);
break;
}
case TYPE_DATETIME: {
Expand All @@ -508,7 +510,9 @@ Status JdbcConnector::_insert_column_data(JNIEnv* env, jobject jobj, const TypeD
}
case TYPE_DATETIMEV2: {
int64_t num = _jobject_to_datetime(env, jobj, true);
reinterpret_cast<vectorized::ColumnVector<vectorized::Int64>*>(col_ptr)->insert_value(num);
uint64_t num2 = static_cast<uint64_t>(num);
reinterpret_cast<vectorized::ColumnVector<vectorized::UInt64>*>(col_ptr)->insert_value(
num2);
break;
}
case TYPE_LARGEINT: {
Expand Down
4 changes: 2 additions & 2 deletions regression-test/data/jdbc_catalog_p0/test_pg_jdbc_catalog.out
Original file line number Diff line number Diff line change
Expand Up @@ -2124,15 +2124,15 @@ true abc def 2022-10-11 1.234 1 2 99 2022-10-22T10:59:59 34.123
2 false 12.123456 10.16.10.14/32 10.16.10.14 ff:ff:ff:ff:ff:ff 0000001010 0000001010 2 {"id": 1}
3 false 12.123456 10.16.10.14/32 10.16.10.14 ff:ff:ff:ff:ff:ff 0000001010 0001010 3 {"id": 1}

-- !test12 --
-- !test13 --
1 (1.0,1.0) {1.0,1.0,1.0} [(1.0,1.0),(2.0,2.0)] (2.0,2.0),(1.0,1.0) ((1.0,1.0),(2.0,2.0),(2.0,1.0)) ((1.0,1.0),(2.0,2.0),(2.0,1.0)) <(0.0,0.0),1.0>
2 (1.0,1.0) {1.0,1.0,1.0} [(1.0,1.0),(2.0,2.0)] (2.0,2.0),(1.0,1.0) [(1.0,1.0),(2.0,2.0),(2.0,1.0)] ((1.0,1.0),(2.0,2.0),(2.0,1.0)) <(0.0,0.0),1.0>
3 (1.1,1.1) {1.0,1.0,1.0} [(1.0,1.0),(2.0,2.0)] (2.0,2.0),(1.0,1.0) [(1.0,1.0),(2.0,2.0),(2.0,1.0)] ((1.0,1.0),(2.0,2.0),(2.0,1.0)) <(0.0,0.0),1.0>
4 (1.12,1.12) {1.0,1.0,1.0} [(1.0,1.0),(2.0,2.0)] (2.0,2.0),(1.0,1.0) [(1.0,1.0),(2.0,2.0),(2.0,1.0)] ((1.0,1.0),(2.0,2.0),(2.0,1.0)) <(0.0,0.0),1.0>
5 (1.12345,1.12345) {1.0,1.0,1.0} [(1.0,1.0),(2.0,2.0)] (2.0,2.0),(1.0,1.0) [(1.0,1.0),(2.0,2.0),(2.0,1.0)] ((1.0,1.0),(2.0,2.0),(2.0,1.0)) <(0.0,0.0),1.0>
6 (1.12345,1.12345) {1.1,1.1,1.1} [(1.2,1.2),(2.3,2.3)] (2.5,2.5),(1.4,1.4) [(1.6,1.6),(2.7,2.7),(2.8,1.8)] ((1.9,1.9),(2.3,2.3),(2.4,1.4)) <(0.2,0.2),1.1>

-- !test12 --
-- !test14 --
1 980dd890-f7fe-4fff-999d-873516108b2e
2 980dd890-f7fe-4fff-999d-873516108b2e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ suite("test_pg_jdbc_catalog", "p0") {

sql """ use ${ex_schema_name2}"""
order_qt_test12 """ select * from test10 order by id; """
order_qt_test12 """ select * from test11 order by id; """
order_qt_test12 """ select * from test12 order by id; """
order_qt_test13 """ select * from test11 order by id; """
order_qt_test14 """ select * from test12 order by id; """

sql """drop catalog if exists ${catalog_name} """
sql """drop resource if exists jdbc_resource_catalog_pg"""
Expand Down