in fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/parser/OceanBaseMysqlAstBuilder.java [1618:1683]
public Node visitTable_option(Table_optionContext ctx) {
if (ctx.SORTKEY() != null) {
List<Identifier> list = ParserHelper.visit(this, ctx.column_name_list().column_name(), Identifier.class);
String cols = list.stream().map(Identifier::getValue).collect(Collectors.joining(","));
return new Property(OceanBasePropertyKey.SORT_KEY.getValue(), cols);
}
if (ctx.TABLE_MODE() != null) {
TerminalNode terminalNode = ctx.STRING_VALUE();
return new Property(OceanBasePropertyKey.TABLE_MODE.getValue(), StripUtils.strip(terminalNode.getText()));
}
if (ctx.COMMENT() != null) {
TerminalNode terminalNode = ctx.STRING_VALUE();
return new Property(OceanBasePropertyKey.COMMENT.getValue(), StripUtils.strip(terminalNode.getText()));
}
if (ctx.COMPRESSION() != null) {
TerminalNode terminalNode = ctx.STRING_VALUE();
return new Property(OceanBasePropertyKey.COMPRESSION.getValue(), StripUtils.strip(terminalNode.getText()));
}
if (ctx.charset_key() != null) {
String value = StripUtils.strip(ctx.charset_name().getText());
return new Property(OceanBasePropertyKey.CHARSET_KEY.getValue(), value);
}
if (ctx.collation_name() != null) {
String value = StripUtils.strip(ctx.collation_name().getText());
return new Property(OceanBasePropertyKey.COLLATE.getValue(), value);
}
if (ctx.ROW_FORMAT() != null) {
return new Property(OceanBasePropertyKey.ROW_FORMAT.getValue(), StripUtils.strip(ctx.row_format_option().getText()));
}
if (ctx.PCTFREE() != null) {
return new Property(OceanBasePropertyKey.PCTFREE.getValue(), ctx.INTNUM().getText());
}
if (ctx.USE_BLOOM_FILTER() != null) {
return new Property(OceanBasePropertyKey.USE_BLOOM_FILTER.getValue(), ctx.BOOL_VALUE().getText());
}
if (ctx.REPLICA_NUM() != null) {
return new Property(OceanBasePropertyKey.REPLICA_NUM.getValue(), ctx.INTNUM().getText());
}
if (ctx.TABLET_SIZE() != null) {
return new Property(OceanBasePropertyKey.TABLET_SIZE.getValue(), ctx.INTNUM().getText());
}
if (ctx.BLOCK_SIZE() != null) {
return new Property(OceanBasePropertyKey.BLOCK_SIZE.getValue(), ctx.INTNUM().getText());
}
if (ctx.STORAGE_FORMAT_VERSION() != null) {
return new Property(OceanBasePropertyKey.STORAGE_FORMAT_VERSION.getValue(), ctx.INTNUM().getText());
}
if (ctx.PROGRESSIVE_MERGE_NUM() != null) {
return new Property(OceanBasePropertyKey.PROGRESSIVE_MERGE_NUM.getValue(), ctx.INTNUM().getText());
}
if (ctx.MAX_USED_PART_ID() != null) {
return new Property(OceanBasePropertyKey.MAX_USED_PART_ID.getValue(), ctx.INTNUM().getText());
}
if (ctx.ENGINE_() != null) {
Node node = visit(ctx.relation_name_or_string());
if (node instanceof StringLiteral) {
StringLiteral stringLiteral = (StringLiteral)node;
return new Property(ExtensionPropertyKey.TABLE_ENGINE.getValue(), stringLiteral.getValue());
} else if (node instanceof Identifier) {
Identifier identifier = (Identifier)node;
return new Property(ExtensionPropertyKey.TABLE_ENGINE.getValue(), identifier.getValue());
}
}
return super.visitTable_option(ctx);
}