Skip to content

Commit a5ce1bd

Browse files
committed
feat: unit test for snowflake dialect
1 parent 7a3b94a commit a5ce1bd

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.flink.connector.jdbc.databases.snowflake.dialect;
20+
21+
import org.apache.flink.connector.jdbc.dialect.JdbcDialectTypeTest;
22+
23+
import java.util.Arrays;
24+
import java.util.List;
25+
26+
/** Tests for all DataTypes and Dialects of JDBC Snowflake connector. */
27+
public class SnowflakeDialectTypeTest extends JdbcDialectTypeTest {
28+
@Override
29+
protected String testDialect() {
30+
return "snowflake";
31+
}
32+
33+
@Override
34+
protected List<JdbcDialectTypeTest.TestItem> testData() {
35+
return Arrays.asList(
36+
createTestItem("BOOLEAN"),
37+
38+
createTestItem("TINYINT"),
39+
createTestItem("SMALLINT"),
40+
createTestItem("BIGINT"),
41+
createTestItem("INT"),
42+
createTestItem("INTEGER"),
43+
44+
createTestItem("DECIMAL"),
45+
createTestItem("NUMERIC"),
46+
47+
createTestItem("DOUBLE"),
48+
createTestItem("FLOAT"),
49+
50+
createTestItem("DECIMAL(10, 4)"),
51+
createTestItem("DECIMAL(38, 18)"),
52+
createTestItem("VARCHAR"),
53+
createTestItem("CHAR"),
54+
createTestItem("VARBINARY"),
55+
createTestItem("DATE"),
56+
createTestItem("TIME"),
57+
createTestItem("TIMESTAMP(3)"),
58+
createTestItem("TIMESTAMP WITHOUT TIME ZONE"),
59+
createTestItem("TIMESTAMP(1) WITHOUT TIME ZONE"),
60+
// Not valid data
61+
createTestItem("TIMESTAMP_LTZ(3)", "Unsupported type:TIMESTAMP_LTZ(3)"));
62+
}
63+
}

0 commit comments

Comments
 (0)