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

Infer Error:automatic column inference not supported for "Nullable(DateTime)" #152

Open
wangxuanyue opened this issue Jul 8, 2022 · 5 comments
Assignees

Comments

@wangxuanyue
Copy link

Auto Infer not support Nullable(DateTime) ?

col := &proto.ColAuto{}
if err := col.Infer(proto.ColumnType("Nullable(DateTime)")); err != nil {
    fmt.Printf("Auto Infer Error: %s\n", err)
}

Error:

Auto Infer Error: automatic column inference not supported for "Nullable(DateTime)"
@wangxuanyue
Copy link
Author

i run sql:

select distinct type from system.columns;

result:

Date
String
LowCardinality(String)
UInt8
Int8
SimpleAggregateFunction(sum, Int64)
AggregateFunction(groupBitmap, UInt64)
SimpleAggregateFunction(max, UInt64)
UInt64
UInt16
Int64
DateTime
AggregateFunction(max, Int64)
SimpleAggregateFunction(groupUniqArrayArray, Array(String))
Int16
Nullable(String)
Int32
Nullable(Int32)
Nullable(DateTime)
DateTime('Asia/Shanghai')
Array(String)
Nullable(Date)
Float64
Nullable(UInt64)
AggregateFunction(groupBitmap, UInt32)
Nullable(UInt8)
UInt32
UUID
Array(DateTime)
DateTime64(6)
Nullable(Int64)
Nullable(UInt32)
Enum8('NOT_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED_AND_RELOADING' = 4, 'LOADED_AND_RELOADING' = 5, 'NOT_EXIST' = 6)
Float32
Enum8('Active' = 0, 'Finished' = 1, 'Unknown' = 2, 'Errored' = 3)
Enum8('ZSESSIONMOVED' = -118, 'ZNOTHING' = -117, 'ZCLOSING' = -116, 'ZAUTHFAILED' = -115, 'ZINVALIDACL' = -114, 'ZINVALIDCALLBACK' = -113, 'ZSESSIONEXPIRED' = -112, 'ZNOTEMPTY' = -111, 'ZNODEEXISTS' = -110, 'ZNOCHILDRENFOREPHEMERALS' = -108, 'ZBADVERSION' = -103, 'ZNOAUTH' = -102, 'ZNONODE' = -101, 'ZAPIERROR' = -100, 'ZINVALIDSTATE' = -9, 'ZBADARGUMENTS' = -8, 'ZOPERATIONTIMEOUT' = -7, 'ZUNIMPLEMENTED' = -6, 'ZMARSHALLINGERROR' = -5, 'ZCONNECTIONLOSS' = -4, 'ZDATAINCONSISTENCY' = -3, 'ZRUNTIMEINCONSISTENCY' = -2, 'ZSYSTEMERROR' = -1, 'ZOK' = 0)
Enum8('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER COLUMN' = 15, 'ALTER ORDER BY' = 16, 'ALTER SAMPLE BY' = 17, 'ALTER ADD INDEX' = 18, 'ALTER DROP INDEX' = 19, 'ALTER MATERIALIZE INDEX' = 20, 'ALTER CLEAR INDEX' = 21, 'ALTER INDEX' = 22, 'ALTER ADD CONSTRAINT' = 23, 'ALTER DROP CONSTRAINT' = 24, 'ALTER CONSTRAINT' = 25, 'ALTER TTL' = 26, 'ALTER MATERIALIZE TTL' = 27, 'ALTER SETTINGS' = 28, 'ALTER MOVE PARTITION' = 29, 'ALTER FETCH PARTITION' = 30, 'ALTER FREEZE PARTITION' = 31, 'ALTER TABLE' = 32, 'ALTER VIEW REFRESH' = 33, 'ALTER VIEW MODIFY QUERY' = 34, 'ALTER VIEW' = 35, 'ALTER' = 36, 'CREATE DATABASE' = 37, 'CREATE TABLE' = 38, 'CREATE VIEW' = 39, 'CREATE DICTIONARY' = 40, 'CREATE TEMPORARY TABLE' = 41, 'CREATE' = 42, 'DROP DATABASE' = 43, 'DROP TABLE' = 44, 'DROP VIEW' = 45, 'DROP DICTIONARY' = 46, 'DROP' = 47, 'TRUNCATE' = 48, 'OPTIMIZE' = 49, 'KILL QUERY' = 50, 'CREATE USER' = 51, 'ALTER USER' = 52, 'DROP USER' = 53, 'CREATE ROLE' = 54, 'ALTER ROLE' = 55, 'DROP ROLE' = 56, 'ROLE ADMIN' = 57, 'CREATE ROW POLICY' = 58, 'ALTER ROW POLICY' = 59, 'DROP ROW POLICY' = 60, 'CREATE QUOTA' = 61, 'ALTER QUOTA' = 62, 'DROP QUOTA' = 63, 'CREATE SETTINGS PROFILE' = 64, 'ALTER SETTINGS PROFILE' = 65, 'DROP SETTINGS PROFILE' = 66, 'SHOW USERS' = 67, 'SHOW ROLES' = 68, 'SHOW ROW POLICIES' = 69, 'SHOW QUOTAS' = 70, 'SHOW SETTINGS PROFILES' = 71, 'SHOW ACCESS' = 72, 'ACCESS MANAGEMENT' = 73, 'SYSTEM SHUTDOWN' = 74, 'SYSTEM DROP DNS CACHE' = 75, 'SYSTEM DROP MARK CACHE' = 76, 'SYSTEM DROP UNCOMPRESSED CACHE' = 77, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 78, 'SYSTEM DROP CACHE' = 79, 'SYSTEM RELOAD CONFIG' = 80, 'SYSTEM RELOAD SYMBOLS' = 81, 'SYSTEM RELOAD DICTIONARY' = 82, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 83, 'SYSTEM RELOAD' = 84, 'SYSTEM MERGES' = 85, 'SYSTEM TTL MERGES' = 86, 'SYSTEM FETCHES' = 87, 'SYSTEM MOVES' = 88, 'SYSTEM DISTRIBUTED SENDS' = 89, 'SYSTEM REPLICATED SENDS' = 90, 'SYSTEM SENDS' = 91, 'SYSTEM REPLICATION QUEUES' = 92, 'SYSTEM DROP REPLICA' = 93, 'SYSTEM SYNC REPLICA' = 94, 'SYSTEM RESTART REPLICA' = 95, 'SYSTEM FLUSH DISTRIBUTED' = 96, 'SYSTEM FLUSH LOGS' = 97, 'SYSTEM FLUSH' = 98, 'SYSTEM' = 99, 'dictGet' = 100, 'addressToLine' = 101, 'addressToSymbol' = 102, 'demangle' = 103, 'INTROSPECTION' = 104, 'FILE' = 105, 'URL' = 106, 'REMOTE' = 107, 'MONGO' = 108, 'MYSQL' = 109, 'POSTGRES' = 110, 'ODBC' = 111, 'JDBC' = 112, 'HDFS' = 113, 'S3' = 114, 'SOURCES' = 115, 'ALL' = 116, 'NONE' = 117)
Array(Int64)
Enum8('NewPart' = 1, 'MergeParts' = 2, 'DownloadPart' = 3, 'RemovePart' = 4, 'MutatePart' = 5, 'MovePart' = 6)
Nullable(Enum8('GLOBAL' = 0, 'DATABASE' = 1, 'TABLE' = 2, 'DICTIONARY' = 3, 'VIEW' = 4, 'COLUMN' = 5))
Nullable(Enum8('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER COLUMN' = 15, 'ALTER ORDER BY' = 16, 'ALTER SAMPLE BY' = 17, 'ALTER ADD INDEX' = 18, 'ALTER DROP INDEX' = 19, 'ALTER MATERIALIZE INDEX' = 20, 'ALTER CLEAR INDEX' = 21, 'ALTER INDEX' = 22, 'ALTER ADD CONSTRAINT' = 23, 'ALTER DROP CONSTRAINT' = 24, 'ALTER CONSTRAINT' = 25, 'ALTER TTL' = 26, 'ALTER MATERIALIZE TTL' = 27, 'ALTER SETTINGS' = 28, 'ALTER MOVE PARTITION' = 29, 'ALTER FETCH PARTITION' = 30, 'ALTER FREEZE PARTITION' = 31, 'ALTER TABLE' = 32, 'ALTER VIEW REFRESH' = 33, 'ALTER VIEW MODIFY QUERY' = 34, 'ALTER VIEW' = 35, 'ALTER' = 36, 'CREATE DATABASE' = 37, 'CREATE TABLE' = 38, 'CREATE VIEW' = 39, 'CREATE DICTIONARY' = 40, 'CREATE TEMPORARY TABLE' = 41, 'CREATE' = 42, 'DROP DATABASE' = 43, 'DROP TABLE' = 44, 'DROP VIEW' = 45, 'DROP DICTIONARY' = 46, 'DROP' = 47, 'TRUNCATE' = 48, 'OPTIMIZE' = 49, 'KILL QUERY' = 50, 'CREATE USER' = 51, 'ALTER USER' = 52, 'DROP USER' = 53, 'CREATE ROLE' = 54, 'ALTER ROLE' = 55, 'DROP ROLE' = 56, 'ROLE ADMIN' = 57, 'CREATE ROW POLICY' = 58, 'ALTER ROW POLICY' = 59, 'DROP ROW POLICY' = 60, 'CREATE QUOTA' = 61, 'ALTER QUOTA' = 62, 'DROP QUOTA' = 63, 'CREATE SETTINGS PROFILE' = 64, 'ALTER SETTINGS PROFILE' = 65, 'DROP SETTINGS PROFILE' = 66, 'SHOW USERS' = 67, 'SHOW ROLES' = 68, 'SHOW ROW POLICIES' = 69, 'SHOW QUOTAS' = 70, 'SHOW SETTINGS PROFILES' = 71, 'SHOW ACCESS' = 72, 'ACCESS MANAGEMENT' = 73, 'SYSTEM SHUTDOWN' = 74, 'SYSTEM DROP DNS CACHE' = 75, 'SYSTEM DROP MARK CACHE' = 76, 'SYSTEM DROP UNCOMPRESSED CACHE' = 77, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 78, 'SYSTEM DROP CACHE' = 79, 'SYSTEM RELOAD CONFIG' = 80, 'SYSTEM RELOAD SYMBOLS' = 81, 'SYSTEM RELOAD DICTIONARY' = 82, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 83, 'SYSTEM RELOAD' = 84, 'SYSTEM MERGES' = 85, 'SYSTEM TTL MERGES' = 86, 'SYSTEM FETCHES' = 87, 'SYSTEM MOVES' = 88, 'SYSTEM DISTRIBUTED SENDS' = 89, 'SYSTEM REPLICATED SENDS' = 90, 'SYSTEM SENDS' = 91, 'SYSTEM REPLICATION QUEUES' = 92, 'SYSTEM DROP REPLICA' = 93, 'SYSTEM SYNC REPLICA' = 94, 'SYSTEM RESTART REPLICA' = 95, 'SYSTEM FLUSH DISTRIBUTED' = 96, 'SYSTEM FLUSH LOGS' = 97, 'SYSTEM FLUSH' = 98, 'SYSTEM' = 99, 'dictGet' = 100, 'addressToLine' = 101, 'addressToSymbol' = 102, 'demangle' = 103, 'INTROSPECTION' = 104, 'FILE' = 105, 'URL' = 106, 'REMOTE' = 107, 'MONGO' = 108, 'MYSQL' = 109, 'POSTGRES' = 110, 'ODBC' = 111, 'JDBC' = 112, 'HDFS' = 113, 'S3' = 114, 'SOURCES' = 115, 'ALL' = 116, 'NONE' = 117))
IPv6
Array(UInt64)
Enum8('QueryStart' = 1, 'QueryFinish' = 2, 'ExceptionBeforeStart' = 3, 'ExceptionWhileProcessing' = 4)
Array(LowCardinality(String))
Nullable(Float64)
Array(Enum8('user_name' = 1, 'ip_address' = 2, 'forwarded_ip_address' = 3, 'client_key' = 4))
Array(UInt32)
Enum8('Fatal' = 1, 'Critical' = 2, 'Error' = 3, 'Warning' = 4, 'Notice' = 5, 'Information' = 6, 'Debug' = 7, 'Trace' = 8)
Enum8('Real' = 0, 'CPU' = 1, 'Memory' = 2, 'MemorySample' = 3)
Enum8('no_password' = 0, 'plaintext_password' = 1, 'sha256_password' = 2, 'double_sha1_password' = 3, 'ldap_server' = 4)

run test:

func main() {
	ctype := [...]string{"Date", "String", "LowCardinality(String)", "UInt8", "Int8", "SimpleAggregateFunction(sum, Int64)", "AggregateFunction(groupBitmap, UInt64)", "SimpleAggregateFunction(max, UInt64)", "UInt64", "UInt16", "Int64", "DateTime", "AggregateFunction(max, Int64)", "SimpleAggregateFunction(groupUniqArrayArray, Array(String))", "Int16", "Nullable(String)", "Int32", "Nullable(Int32)", "Nullable(DateTime)", "DateTime('Asia/Shanghai')", "Array(String)", "Nullable(Date)", "Float64", "Nullable(UInt64)", "AggregateFunction(groupBitmap, UInt32)", "Nullable(UInt8)", "UInt32", "UUID", "Array(DateTime)", "DateTime64(6)", "Nullable(Int64)", "Nullable(UInt32)", "Enum8('NOT_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED_AND_RELOADING' = 4, 'LOADED_AND_RELOADING' = 5, 'NOT_EXIST' = 6)", "Float32", "Enum8('Active' = 0, 'Finished' = 1, 'Unknown' = 2, 'Errored' = 3)", "Enum8('ZSESSIONMOVED' = -118, 'ZNOTHING' = -117, 'ZCLOSING' = -116, 'ZAUTHFAILED' = -115, 'ZINVALIDACL' = -114, 'ZINVALIDCALLBACK' = -113, 'ZSESSIONEXPIRED' = -112, 'ZNOTEMPTY' = -111, 'ZNODEEXISTS' = -110, 'ZNOCHILDRENFOREPHEMERALS' = -108, 'ZBADVERSION' = -103, 'ZNOAUTH' = -102, 'ZNONODE' = -101, 'ZAPIERROR' = -100, 'ZINVALIDSTATE' = -9, 'ZBADARGUMENTS' = -8, 'ZOPERATIONTIMEOUT' = -7, 'ZUNIMPLEMENTED' = -6, 'ZMARSHALLINGERROR' = -5, 'ZCONNECTIONLOSS' = -4, 'ZDATAINCONSISTENCY' = -3, 'ZRUNTIMEINCONSISTENCY' = -2, 'ZSYSTEMERROR' = -1, 'ZOK' = 0)", "Enum8('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER COLUMN' = 15, 'ALTER ORDER BY' = 16, 'ALTER SAMPLE BY' = 17, 'ALTER ADD INDEX' = 18, 'ALTER DROP INDEX' = 19, 'ALTER MATERIALIZE INDEX' = 20, 'ALTER CLEAR INDEX' = 21, 'ALTER INDEX' = 22, 'ALTER ADD CONSTRAINT' = 23, 'ALTER DROP CONSTRAINT' = 24, 'ALTER CONSTRAINT' = 25, 'ALTER TTL' = 26, 'ALTER MATERIALIZE TTL' = 27, 'ALTER SETTINGS' = 28, 'ALTER MOVE PARTITION' = 29, 'ALTER FETCH PARTITION' = 30, 'ALTER FREEZE PARTITION' = 31, 'ALTER TABLE' = 32, 'ALTER VIEW REFRESH' = 33, 'ALTER VIEW MODIFY QUERY' = 34, 'ALTER VIEW' = 35, 'ALTER' = 36, 'CREATE DATABASE' = 37, 'CREATE TABLE' = 38, 'CREATE VIEW' = 39, 'CREATE DICTIONARY' = 40, 'CREATE TEMPORARY TABLE' = 41, 'CREATE' = 42, 'DROP DATABASE' = 43, 'DROP TABLE' = 44, 'DROP VIEW' = 45, 'DROP DICTIONARY' = 46, 'DROP' = 47, 'TRUNCATE' = 48, 'OPTIMIZE' = 49, 'KILL QUERY' = 50, 'CREATE USER' = 51, 'ALTER USER' = 52, 'DROP USER' = 53, 'CREATE ROLE' = 54, 'ALTER ROLE' = 55, 'DROP ROLE' = 56, 'ROLE ADMIN' = 57, 'CREATE ROW POLICY' = 58, 'ALTER ROW POLICY' = 59, 'DROP ROW POLICY' = 60, 'CREATE QUOTA' = 61, 'ALTER QUOTA' = 62, 'DROP QUOTA' = 63, 'CREATE SETTINGS PROFILE' = 64, 'ALTER SETTINGS PROFILE' = 65, 'DROP SETTINGS PROFILE' = 66, 'SHOW USERS' = 67, 'SHOW ROLES' = 68, 'SHOW ROW POLICIES' = 69, 'SHOW QUOTAS' = 70, 'SHOW SETTINGS PROFILES' = 71, 'SHOW ACCESS' = 72, 'ACCESS MANAGEMENT' = 73, 'SYSTEM SHUTDOWN' = 74, 'SYSTEM DROP DNS CACHE' = 75, 'SYSTEM DROP MARK CACHE' = 76, 'SYSTEM DROP UNCOMPRESSED CACHE' = 77, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 78, 'SYSTEM DROP CACHE' = 79, 'SYSTEM RELOAD CONFIG' = 80, 'SYSTEM RELOAD SYMBOLS' = 81, 'SYSTEM RELOAD DICTIONARY' = 82, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 83, 'SYSTEM RELOAD' = 84, 'SYSTEM MERGES' = 85, 'SYSTEM TTL MERGES' = 86, 'SYSTEM FETCHES' = 87, 'SYSTEM MOVES' = 88, 'SYSTEM DISTRIBUTED SENDS' = 89, 'SYSTEM REPLICATED SENDS' = 90, 'SYSTEM SENDS' = 91, 'SYSTEM REPLICATION QUEUES' = 92, 'SYSTEM DROP REPLICA' = 93, 'SYSTEM SYNC REPLICA' = 94, 'SYSTEM RESTART REPLICA' = 95, 'SYSTEM FLUSH DISTRIBUTED' = 96, 'SYSTEM FLUSH LOGS' = 97, 'SYSTEM FLUSH' = 98, 'SYSTEM' = 99, 'dictGet' = 100, 'addressToLine' = 101, 'addressToSymbol' = 102, 'demangle' = 103, 'INTROSPECTION' = 104, 'FILE' = 105, 'URL' = 106, 'REMOTE' = 107, 'MONGO' = 108, 'MYSQL' = 109, 'POSTGRES' = 110, 'ODBC' = 111, 'JDBC' = 112, 'HDFS' = 113, 'S3' = 114, 'SOURCES' = 115, 'ALL' = 116, 'NONE' = 117)", "Array(Int64)", "Enum8('NewPart' = 1, 'MergeParts' = 2, 'DownloadPart' = 3, 'RemovePart' = 4, 'MutatePart' = 5, 'MovePart' = 6)", "Nullable(Enum8('GLOBAL' = 0, 'DATABASE' = 1, 'TABLE' = 2, 'DICTIONARY' = 3, 'VIEW' = 4, 'COLUMN' = 5))", "Nullable(Enum8('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER COLUMN' = 15, 'ALTER ORDER BY' = 16, 'ALTER SAMPLE BY' = 17, 'ALTER ADD INDEX' = 18, 'ALTER DROP INDEX' = 19, 'ALTER MATERIALIZE INDEX' = 20, 'ALTER CLEAR INDEX' = 21, 'ALTER INDEX' = 22, 'ALTER ADD CONSTRAINT' = 23, 'ALTER DROP CONSTRAINT' = 24, 'ALTER CONSTRAINT' = 25, 'ALTER TTL' = 26, 'ALTER MATERIALIZE TTL' = 27, 'ALTER SETTINGS' = 28, 'ALTER MOVE PARTITION' = 29, 'ALTER FETCH PARTITION' = 30, 'ALTER FREEZE PARTITION' = 31, 'ALTER TABLE' = 32, 'ALTER VIEW REFRESH' = 33, 'ALTER VIEW MODIFY QUERY' = 34, 'ALTER VIEW' = 35, 'ALTER' = 36, 'CREATE DATABASE' = 37, 'CREATE TABLE' = 38, 'CREATE VIEW' = 39, 'CREATE DICTIONARY' = 40, 'CREATE TEMPORARY TABLE' = 41, 'CREATE' = 42, 'DROP DATABASE' = 43, 'DROP TABLE' = 44, 'DROP VIEW' = 45, 'DROP DICTIONARY' = 46, 'DROP' = 47, 'TRUNCATE' = 48, 'OPTIMIZE' = 49, 'KILL QUERY' = 50, 'CREATE USER' = 51, 'ALTER USER' = 52, 'DROP USER' = 53, 'CREATE ROLE' = 54, 'ALTER ROLE' = 55, 'DROP ROLE' = 56, 'ROLE ADMIN' = 57, 'CREATE ROW POLICY' = 58, 'ALTER ROW POLICY' = 59, 'DROP ROW POLICY' = 60, 'CREATE QUOTA' = 61, 'ALTER QUOTA' = 62, 'DROP QUOTA' = 63, 'CREATE SETTINGS PROFILE' = 64, 'ALTER SETTINGS PROFILE' = 65, 'DROP SETTINGS PROFILE' = 66, 'SHOW USERS' = 67, 'SHOW ROLES' = 68, 'SHOW ROW POLICIES' = 69, 'SHOW QUOTAS' = 70, 'SHOW SETTINGS PROFILES' = 71, 'SHOW ACCESS' = 72, 'ACCESS MANAGEMENT' = 73, 'SYSTEM SHUTDOWN' = 74, 'SYSTEM DROP DNS CACHE' = 75, 'SYSTEM DROP MARK CACHE' = 76, 'SYSTEM DROP UNCOMPRESSED CACHE' = 77, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 78, 'SYSTEM DROP CACHE' = 79, 'SYSTEM RELOAD CONFIG' = 80, 'SYSTEM RELOAD SYMBOLS' = 81, 'SYSTEM RELOAD DICTIONARY' = 82, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 83, 'SYSTEM RELOAD' = 84, 'SYSTEM MERGES' = 85, 'SYSTEM TTL MERGES' = 86, 'SYSTEM FETCHES' = 87, 'SYSTEM MOVES' = 88, 'SYSTEM DISTRIBUTED SENDS' = 89, 'SYSTEM REPLICATED SENDS' = 90, 'SYSTEM SENDS' = 91, 'SYSTEM REPLICATION QUEUES' = 92, 'SYSTEM DROP REPLICA' = 93, 'SYSTEM SYNC REPLICA' = 94, 'SYSTEM RESTART REPLICA' = 95, 'SYSTEM FLUSH DISTRIBUTED' = 96, 'SYSTEM FLUSH LOGS' = 97, 'SYSTEM FLUSH' = 98, 'SYSTEM' = 99, 'dictGet' = 100, 'addressToLine' = 101, 'addressToSymbol' = 102, 'demangle' = 103, 'INTROSPECTION' = 104, 'FILE' = 105, 'URL' = 106, 'REMOTE' = 107, 'MONGO' = 108, 'MYSQL' = 109, 'POSTGRES' = 110, 'ODBC' = 111, 'JDBC' = 112, 'HDFS' = 113, 'S3' = 114, 'SOURCES' = 115, 'ALL' = 116, 'NONE' = 117))", "IPv6", "Array(UInt64)", "Enum8('QueryStart' = 1, 'QueryFinish' = 2, 'ExceptionBeforeStart' = 3, 'ExceptionWhileProcessing' = 4)", "Array(LowCardinality(String))", "Nullable(Float64)", "Array(Enum8('user_name' = 1, 'ip_address' = 2, 'forwarded_ip_address' = 3, 'client_key' = 4))", "Array(UInt32)", "Enum8('Fatal' = 1, 'Critical' = 2, 'Error' = 3, 'Warning' = 4, 'Notice' = 5, 'Information' = 6, 'Debug' = 7, 'Trace' = 8)", "Enum8('Real' = 0, 'CPU' = 1, 'Memory' = 2, 'MemorySample' = 3)", "Enum8('no_password' = 0, 'plaintext_password' = 1, 'sha256_password' = 2, 'double_sha1_password' = 3, 'ldap_server' = 4)"}
	for i := 0; i < len(ctype); i++ {
		acol := &proto.ColAuto{}
		if err := acol.Infer(proto.ColumnType(ctype[i])); err != nil {
			fmt.Printf("Auto Infer Error: %s\n", err)
		}
	}
}

result:

Auto Infer Error: automatic column inference not supported for "SimpleAggregateFunction(sum, Int64)"
Auto Infer Error: automatic column inference not supported for "AggregateFunction(groupBitmap, UInt64)"
Auto Infer Error: automatic column inference not supported for "SimpleAggregateFunction(max, UInt64)"
Auto Infer Error: automatic column inference not supported for "AggregateFunction(max, Int64)"
Auto Infer Error: automatic column inference not supported for "SimpleAggregateFunction(groupUniqArrayArray, Array(String))"
Auto Infer Error: automatic column inference not supported for "Nullable(DateTime)"
Auto Infer Error: automatic column inference not supported for "AggregateFunction(groupBitmap, UInt32)"
Auto Infer Error: automatic column inference not supported for "UUID"
Auto Infer Error: automatic column inference not supported for "Array(DateTime)"
Auto Infer Error: automatic column inference not supported for "Nullable(Enum8('GLOBAL' = 0, 'DATABASE' = 1, 'TABLE' = 2, 'DICTIONARY' = 3, 'VIEW' = 4, 'COLUMN' = 5))"
Auto Infer Error: automatic column inference not supported for "Nullable(Enum8('SHOW DATABASES' = 0, 'SHOW TABLES' = 1, 'SHOW COLUMNS' = 2, 'SHOW DICTIONARIES' = 3, 'SHOW' = 4, 'SELECT' = 5, 'INSERT' = 6, 'ALTER UPDATE' = 7, 'ALTER DELETE' = 8, 'ALTER ADD COLUMN' = 9, 'ALTER MODIFY COLUMN' = 10, 'ALTER DROP COLUMN' = 11, 'ALTER COMMENT COLUMN' = 12, 'ALTER CLEAR COLUMN' = 13, 'ALTER RENAME COLUMN' = 14, 'ALTER COLUMN' = 15, 'ALTER ORDER BY' = 16, 'ALTER SAMPLE BY' = 17, 'ALTER ADD INDEX' = 18, 'ALTER DROP INDEX' = 19, 'ALTER MATERIALIZE INDEX' = 20, 'ALTER CLEAR INDEX' = 21, 'ALTER INDEX' = 22, 'ALTER ADD CONSTRAINT' = 23, 'ALTER DROP CONSTRAINT' = 24, 'ALTER CONSTRAINT' = 25, 'ALTER TTL' = 26, 'ALTER MATERIALIZE TTL' = 27, 'ALTER SETTINGS' = 28, 'ALTER MOVE PARTITION' = 29, 'ALTER FETCH PARTITION' = 30, 'ALTER FREEZE PARTITION' = 31, 'ALTER TABLE' = 32, 'ALTER VIEW REFRESH' = 33, 'ALTER VIEW MODIFY QUERY' = 34, 'ALTER VIEW' = 35, 'ALTER' = 36, 'CREATE DATABASE' = 37, 'CREATE TABLE' = 38, 'CREATE VIEW' = 39, 'CREATE DICTIONARY' = 40, 'CREATE TEMPORARY TABLE' = 41, 'CREATE' = 42, 'DROP DATABASE' = 43, 'DROP TABLE' = 44, 'DROP VIEW' = 45, 'DROP DICTIONARY' = 46, 'DROP' = 47, 'TRUNCATE' = 48, 'OPTIMIZE' = 49, 'KILL QUERY' = 50, 'CREATE USER' = 51, 'ALTER USER' = 52, 'DROP USER' = 53, 'CREATE ROLE' = 54, 'ALTER ROLE' = 55, 'DROP ROLE' = 56, 'ROLE ADMIN' = 57, 'CREATE ROW POLICY' = 58, 'ALTER ROW POLICY' = 59, 'DROP ROW POLICY' = 60, 'CREATE QUOTA' = 61, 'ALTER QUOTA' = 62, 'DROP QUOTA' = 63, 'CREATE SETTINGS PROFILE' = 64, 'ALTER SETTINGS PROFILE' = 65, 'DROP SETTINGS PROFILE' = 66, 'SHOW USERS' = 67, 'SHOW ROLES' = 68, 'SHOW ROW POLICIES' = 69, 'SHOW QUOTAS' = 70, 'SHOW SETTINGS PROFILES' = 71, 'SHOW ACCESS' = 72, 'ACCESS MANAGEMENT' = 73, 'SYSTEM SHUTDOWN' = 74, 'SYSTEM DROP DNS CACHE' = 75, 'SYSTEM DROP MARK CACHE' = 76, 'SYSTEM DROP UNCOMPRESSED CACHE' = 77, 'SYSTEM DROP COMPILED EXPRESSION CACHE' = 78, 'SYSTEM DROP CACHE' = 79, 'SYSTEM RELOAD CONFIG' = 80, 'SYSTEM RELOAD SYMBOLS' = 81, 'SYSTEM RELOAD DICTIONARY' = 82, 'SYSTEM RELOAD EMBEDDED DICTIONARIES' = 83, 'SYSTEM RELOAD' = 84, 'SYSTEM MERGES' = 85, 'SYSTEM TTL MERGES' = 86, 'SYSTEM FETCHES' = 87, 'SYSTEM MOVES' = 88, 'SYSTEM DISTRIBUTED SENDS' = 89, 'SYSTEM REPLICATED SENDS' = 90, 'SYSTEM SENDS' = 91, 'SYSTEM REPLICATION QUEUES' = 92, 'SYSTEM DROP REPLICA' = 93, 'SYSTEM SYNC REPLICA' = 94, 'SYSTEM RESTART REPLICA' = 95, 'SYSTEM FLUSH DISTRIBUTED' = 96, 'SYSTEM FLUSH LOGS' = 97, 'SYSTEM FLUSH' = 98, 'SYSTEM' = 99, 'dictGet' = 100, 'addressToLine' = 101, 'addressToSymbol' = 102, 'demangle' = 103, 'INTROSPECTION' = 104, 'FILE' = 105, 'URL' = 106, 'REMOTE' = 107, 'MONGO' = 108, 'MYSQL' = 109, 'POSTGRES' = 110, 'ODBC' = 111, 'JDBC' = 112, 'HDFS' = 113, 'S3' = 114, 'SOURCES' = 115, 'ALL' = 116, 'NONE' = 117))"
Auto Infer Error: automatic column inference not supported for "Array(Enum8('user_name' = 1, 'ip_address' = 2, 'forwarded_ip_address' = 3, 'client_key' = 4))"

@ernado
Copy link
Collaborator

ernado commented Jul 8, 2022

Yes, inference is not fully implemented.

Not sure how to do it, probably with reflect.

@genzgd
Copy link
Contributor

genzgd commented Mar 14, 2023

I can understand why this might be broken for some more advanced types, but it seems like Nullable(DateTime) and Array(DateTime) should work (since Nullable(Date) is basically the same). It looks like generated files aren't being created for DateTime, even though DateTime is in the /cmd/main.go generator. @jkaflik -- do you have any ideas on this?

@genzgd
Copy link
Contributor

genzgd commented Mar 15, 2023

Okay, DateTime types are specifically excluded by this line:

if !v.DateTime() {
    if err := write(base+"_gen", v, tpl); err != nil {
        return errors.Wrap(err, "write")
    }
}

So it requires more effort than I originally thought.

@serprex serprex self-assigned this Oct 13, 2024
@serprex
Copy link
Member

serprex commented Oct 13, 2024

Would be made easier by golang/go#54393 since then it'd be straightforward to infer X in Nullable(X) & then wrap into ColNullable[T]

I guess for now reflection can be used to take pot shot at duck typed Nullable method

serprex added a commit that referenced this issue Oct 16, 2024
helps re #152

couple fixes needed to get Array(Nullable(...)) & Nullable(DateTime64(...)) cases to work
serprex added a commit that referenced this issue Oct 17, 2024
helps re #152

couple fixes needed to get Array(Nullable(...)) & Nullable(DateTime64(...)) cases to work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants