blob: 79c03996f6fcbd95a18d969e5d20ffc5f80e4f88 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
source_table = """ CREATE TABLE source ( `user_id` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, `name` CHAR ( 10 ), `age` INT ) """
sink_table = """ CREATE TABLE sink ( `user_id` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, `name` CHAR ( 10 ), `age` INT ) """
type_source_table = """
CREATE TABLE `type_source_table` (
`binary` BINARY ( 64 ) DEFAULT NULL,
`blob` BLOB,
`long_varbinary` MEDIUMBLOB,
`longblob` LONGBLOB,
`tinyblob` TINYBLOB,
`varbinary` VARBINARY ( 100 ) DEFAULT NULL,
`tinyint` TINYINT DEFAULT NULL,
`tinyint_unsigned` TINYINT UNSIGNED DEFAULT NULL,
`smallint` SMALLINT DEFAULT NULL,
`smallint_unsigned` SMALLINT UNSIGNED DEFAULT NULL,
`mediumint` MEDIUMINT DEFAULT NULL,
`mediumint_unsigned` MEDIUMINT UNSIGNED DEFAULT NULL,
`int` INT DEFAULT NULL,
`int_unsigned` INT UNSIGNED DEFAULT NULL,
`integer` INT DEFAULT NULL,
`integer_unsigned` INT UNSIGNED DEFAULT NULL,
`bigint` BIGINT DEFAULT NULL,
`bigint_unsigned` BIGINT UNSIGNED DEFAULT NULL,
`numeric` DECIMAL ( 10, 0 ) DEFAULT NULL,
`decimal` DECIMAL ( 10, 0 ) DEFAULT NULL,
`float` FLOAT DEFAULT NULL,
`double` DOUBLE DEFAULT NULL,
`double_precision` DOUBLE DEFAULT NULL,
`longtext` LONGTEXT,
`mediumtext` MEDIUMTEXT,
`text` text,
`tinytext` TINYTEXT,
`varchar` VARCHAR ( 100 ) DEFAULT NULL,
`json` json DEFAULT NULL,
`date` date DEFAULT NULL,
`datetime` datetime DEFAULT NULL,
`year` YEAR DEFAULT NULL,
`timestamp` TIMESTAMP NULL DEFAULT NULL
)
"""
type_sink_table = """
CREATE TABLE `type_sink_table` (
`binary` BINARY ( 64 ) DEFAULT NULL,
`blob` BLOB,
`long_varbinary` MEDIUMBLOB,
`longblob` LONGBLOB,
`tinyblob` TINYBLOB,
`varbinary` VARBINARY ( 100 ) DEFAULT NULL,
`tinyint` TINYINT DEFAULT NULL,
`tinyint_unsigned` TINYINT UNSIGNED DEFAULT NULL,
`smallint` SMALLINT DEFAULT NULL,
`smallint_unsigned` SMALLINT UNSIGNED DEFAULT NULL,
`mediumint` MEDIUMINT DEFAULT NULL,
`mediumint_unsigned` MEDIUMINT UNSIGNED DEFAULT NULL,
`int` INT DEFAULT NULL,
`int_unsigned` INT UNSIGNED DEFAULT NULL,
`integer` INT DEFAULT NULL,
`integer_unsigned` INT UNSIGNED DEFAULT NULL,
`bigint` BIGINT DEFAULT NULL,
`bigint_unsigned` BIGINT UNSIGNED DEFAULT NULL,
`numeric` DECIMAL ( 10, 0 ) DEFAULT NULL,
`decimal` DECIMAL ( 10, 0 ) DEFAULT NULL,
`float` FLOAT DEFAULT NULL,
`double` DOUBLE DEFAULT NULL,
`double_precision` DOUBLE DEFAULT NULL,
`longtext` LONGTEXT,
`mediumtext` MEDIUMTEXT,
`text` text,
`tinytext` TINYTEXT,
`varchar` VARCHAR ( 100 ) DEFAULT NULL,
`json` json DEFAULT NULL,
`date` date DEFAULT NULL,
`datetime` datetime DEFAULT NULL,
`year` YEAR DEFAULT NULL,
`timestamp` TIMESTAMP NULL DEFAULT NULL
)
"""
insert_type_source_table_sql = """
INSERT INTO `type_source_table` (
`binary`,
`blob`,
`long_varbinary`,
`longblob`,
`tinyblob`,
`varbinary`,
`tinyint`,
`tinyint_unsigned`,
`smallint`,
`smallint_unsigned`,
`mediumint`,
`mediumint_unsigned`,
`int`,
`int_unsigned`,
`integer`,
`integer_unsigned`,
`bigint`,
`bigint_unsigned`,
`numeric`,
`decimal`,
`float`,
`double`,
`double_precision`,
`longtext`,
`mediumtext`,
`text`,
`tinytext`,
`varchar`,
`json`,
`date`,
`datetime`,
`year`,
`timestamp`
)
VALUES
(
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
'a',
'a',
'a',
'a',
'a',
'{}',
'2022-09-22',
'2022-09-22 15:07:44',
2022,
'2022-09-22 15:07:55'
)
"""
check_type_sink_table_sql = """
SELECT
count( 1 )
FROM
( SELECT * FROM type_source_table UNION ALL SELECT * FROM type_sink_table ) a
GROUP BY
`binary`,
`blob`,
`long_varbinary`,
`longblob`,
`tinyblob`,
`varbinary`,
`tinyint`,
`tinyint_unsigned`,
`smallint`,
`smallint_unsigned`,
`mediumint`,
`mediumint_unsigned`,
`int`,
`int_unsigned`,
`integer`,
`integer_unsigned`,
`bigint`,
`bigint_unsigned`,
`numeric`,
`decimal`,
`float`,
`double`,
`double_precision`,
`longtext`,
`mediumtext`,
`text`,
`tinytext`,
`varchar`,
`json`,
`date`,
`datetime`,
`year`,
`timestamp`
"""