TODO percy this is too naive ... improve this later String Data Types Data type Description CHAR(size) A FIXED length string (can contain letters, numbers, and special characters). The size parameter specifies the column length in characters - can be from 0 to 255. Default is 1 VARCHAR(size) A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifi
| 36 | //ENUM(val1, val2, val3, ...) A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them |
| 37 | //SET(val1, val2, val3, ...) |
| 38 | bool mysql_is_cudf_string(const std::string &t) { |
| 39 | std::vector<std::string> mysql_string_types_hints = { |
| 40 | "CHAR", |
| 41 | "VARCHAR", |
| 42 | "BINARY", |
| 43 | "VARBINARY", |
| 44 | "TINYBLOB", |
| 45 | "TINYTEXT", |
| 46 | "TEXT", |
| 47 | "BLOB", |
| 48 | "MEDIUMTEXT", |
| 49 | "MEDIUMBLOB", |
| 50 | "LONGTEXT", |
| 51 | "LONGBLOB", |
| 52 | "ENUM", |
| 53 | "SET" |
| 54 | }; |
| 55 | |
| 56 | for (auto hint : mysql_string_types_hints) { |
| 57 | if (StringUtil::beginsWith(t, hint)) return true; |
| 58 | } |
| 59 | |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | cudf::type_id parse_mysql_column_type(const std::string t) { |
| 64 | if (mysql_is_cudf_string(t)) return cudf::type_id::STRING; |
no outgoing calls
no test coverage detected