Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class MysqlTypeConverter extends JdbcTypeConverter {
static final String CHAR = "char";
static final String BINARY = "binary";
static final String DATETIME = "datetime";
static final String TINYTEXT = "tinytext";
static final String MEDIUMTEXT = "mediumtext";
static final String LONGTEXT = "longtext";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also need to update the relative user doc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it


@Override
public Type toGravitino(JdbcTypeBean typeBean) {
Expand Down Expand Up @@ -97,6 +100,9 @@ public Type toGravitino(JdbcTypeBean typeBean) {
case CHAR:
return Types.FixedCharType.of(typeBean.getColumnSize());
case TEXT:
case TINYTEXT:
case MEDIUMTEXT:
case LONGTEXT:
return Types.StringType.get();
Comment on lines +103 to 106
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These four types will cast to the same type String, will this cause user confusion?

case BINARY:
return Types.BinaryType.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.DOUBLE;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.FLOAT;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.INT;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.LONGTEXT;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.MEDIUMTEXT;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.TINYINT;
import static org.apache.gravitino.catalog.mysql.converter.MysqlTypeConverter.TINYTEXT;

import org.apache.gravitino.catalog.jdbc.converter.JdbcTypeConverter;
import org.apache.gravitino.rel.types.Type;
Expand Down Expand Up @@ -77,6 +80,9 @@ public void testToGravitinoType() {
checkJdbcTypeToGravitinoType(Types.VarCharType.of(20), VARCHAR, 20, null, 0);
checkJdbcTypeToGravitinoType(Types.FixedCharType.of(20), CHAR, 20, null, 0);
checkJdbcTypeToGravitinoType(Types.StringType.get(), TEXT, null, null, 0);
checkJdbcTypeToGravitinoType(Types.StringType.get(), TINYTEXT, null, null, 0);
checkJdbcTypeToGravitinoType(Types.StringType.get(), MEDIUMTEXT, null, null, 0);
checkJdbcTypeToGravitinoType(Types.StringType.get(), LONGTEXT, null, null, 0);
checkJdbcTypeToGravitinoType(Types.BinaryType.get(), BINARY, null, null, 0);
checkJdbcTypeToGravitinoType(
Types.ExternalType.of(USER_DEFINED_TYPE), USER_DEFINED_TYPE, null, null, 0);
Expand Down