├── .gitignore ├── CHANGELOG ├── LICENSE ├── NOTICE ├── README.md ├── README_zh_CN.md ├── cd.json ├── docs ├── .nojekyll ├── Alibaba_CodeStyle.xml ├── index.html └── zh-cn │ ├── _sidebar.md │ ├── basic.md │ ├── command │ └── impexp.md │ ├── difference.md │ ├── guide.md │ ├── how-to-contribute.md │ ├── ide │ └── design.md │ ├── indicator │ ├── adjunct.md │ ├── atomic.md │ ├── derivative.md │ └── time_period.md │ ├── jdbc │ ├── cli.md │ └── guide.md │ ├── layer │ ├── business_category.md │ ├── business_process.md │ ├── data_domain.md │ ├── data_layer.md │ └── guide.md │ ├── model │ ├── column.md │ ├── dimension.md │ ├── quality.md │ └── table.md │ ├── query │ └── guide.md │ ├── references │ ├── move_references.md │ └── show_references.md │ ├── reverse │ └── model.md │ ├── roadmap.md │ ├── standard │ ├── code_table.md │ ├── measure_unit.md │ └── standard_dict.md │ └── transformer │ ├── compare.md │ ├── guide.md │ ├── hologres.md │ ├── other.md │ └── table.md ├── fastmodel-benchmarks ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── benchmarks │ │ │ ├── PerformanceExec.java │ │ │ ├── PerformanceUtil.java │ │ │ ├── Tpch.java │ │ │ └── parser │ │ │ └── SqlParserBenchMark.java │ └── resources │ │ ├── performance │ │ ├── dsl-test.txt │ │ └── single.txt │ │ └── tpch │ │ ├── 1.sql │ │ ├── 10.sql │ │ ├── 11.sql │ │ ├── 12.sql │ │ ├── 13.sql │ │ ├── 14.sql │ │ ├── 15.sql │ │ ├── 16.sql │ │ ├── 17.sql │ │ ├── 18.sql │ │ ├── 19.sql │ │ ├── 2.sql │ │ ├── 20.sql │ │ ├── 21.sql │ │ ├── 22.sql │ │ ├── 3.sql │ │ ├── 4.sql │ │ ├── 5.sql │ │ ├── 6.sql │ │ ├── 7.sql │ │ ├── 8.sql │ │ └── 9.sql │ └── test │ └── java │ └── com │ └── aliyun │ └── fastmodel │ └── benchmark │ ├── PerformanceTest.java │ └── TpchTest.java ├── fastmodel-bom └── pom.xml ├── fastmodel-common ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── common │ │ ├── parser │ │ ├── IgnoreErrorListener.java │ │ ├── ParserHelper.java │ │ ├── ThrowingErrorListener.java │ │ └── lexer │ │ │ └── CaseChangingCharStream.java │ │ └── utils │ │ └── StripUtils.java │ └── test │ └── java │ └── com │ └── aliyun │ └── fastmodel │ └── common │ ├── parser │ └── ParserHelperTest.java │ └── utils │ └── StripUtilsTest.java ├── fastmodel-compare ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── compare │ │ ├── CompareNodeExecute.java │ │ ├── CompareStrategy.java │ │ ├── MergeNodeExecute.java │ │ ├── impl │ │ ├── BaseCompareNode.java │ │ ├── CompositeCompareNode.java │ │ ├── CreateTableCompareNode.java │ │ ├── DropTableCompareNode.java │ │ ├── helper │ │ │ └── ComparePair.java │ │ └── table │ │ │ ├── AliasCompare.java │ │ │ ├── ColumnCompare.java │ │ │ ├── CommentCompare.java │ │ │ ├── ConstraintCompare.java │ │ │ ├── PartitionByCompare.java │ │ │ ├── PropertiesCompare.java │ │ │ ├── TableElementCompare.java │ │ │ ├── TableIndexCompare.java │ │ │ ├── TableNameCompare.java │ │ │ └── column │ │ │ ├── OrderColumn.java │ │ │ └── OrderColumnManager.java │ │ ├── merge │ │ ├── Pipeline.java │ │ ├── PipelineComponent.java │ │ └── impl │ │ │ ├── AddColsPipeline.java │ │ │ ├── AddConstraintPipeline.java │ │ │ ├── AddPartitionColPipeline.java │ │ │ ├── ChangeColPipeline.java │ │ │ ├── DropColPipeline.java │ │ │ ├── DropConstraintPipeline.java │ │ │ ├── DropPartitionColPipeline.java │ │ │ ├── RenameTablePipeLine.java │ │ │ ├── SetColumnOrderPipeline.java │ │ │ ├── SetTableAliasedNamePipeLine.java │ │ │ ├── SetTableCommentPipeLine.java │ │ │ ├── SetTablePropertiesPipeLine.java │ │ │ └── UnSetTablePropertiesPipeline.java │ │ └── util │ │ ├── CompareUtil.java │ │ └── MergeTableUtil.java │ └── test │ └── java │ └── com │ └── aliyun │ └── fastmodel │ └── compare │ ├── CompareNodeExecuteTest.java │ ├── CompareUtilTest.java │ ├── diff │ └── DiffUtilsTest.java │ ├── impl │ ├── CompositeCompareNodeTest.java │ ├── CreateDwsTableCompareNodeTest.java │ ├── CreateTableCompareNodeTest.java │ └── DropTableCompareNodeTest.java │ ├── merge │ ├── MergeNodeExecuteTest.java │ └── impl │ │ ├── AddColsPipelineTest.java │ │ ├── AddConstraintPipelineTest.java │ │ ├── AddPartitionColPipelineTest.java │ │ ├── ChangeColPipelineTest.java │ │ ├── DropColPipelineTest.java │ │ ├── DropConstraintPipelineTest.java │ │ ├── DropPartitionColPipelineTest.java │ │ ├── RenameTablePipeLineTest.java │ │ ├── SetColumnOrderPipelineTest.java │ │ ├── SetTableAliasedNamePipeLineTest.java │ │ ├── SetTableCommentPipeLineTest.java │ │ ├── SetTablePropertiesPipeLineTest.java │ │ └── UnSetTablePropertiesPipelineTest.java │ ├── table │ ├── ColumnCompareTest.java │ ├── ConstraintCompareTest.java │ ├── TableIndexCompareTest.java │ └── column │ │ └── OrderColumnManagerTest.java │ └── util │ └── MergeTableUtilTest.java ├── fastmodel-converter ├── fastmodel-converter-dqc │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── conveter │ │ │ └── dqc │ │ │ ├── BaseDqcStatementConverter.java │ │ │ ├── DefaultConvertContext.java │ │ │ ├── check │ │ │ ├── AddColsConverter.java │ │ │ ├── AddPrimaryKeyConverter.java │ │ │ ├── ChangeColConverter.java │ │ │ ├── CreateTableConverter.java │ │ │ ├── DropColConverter.java │ │ │ ├── DropPrimaryConstraintConverter.java │ │ │ └── DropTableConverter.java │ │ │ └── util │ │ │ └── FmlTableUtil.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── dqc │ │ ├── ConverterFactoryTest.java │ │ ├── check │ │ ├── AddColsConverterTest.java │ │ ├── AddPrimaryKeyConverterTest.java │ │ ├── ChangeColConverterTest.java │ │ ├── CreateTableConverterTest.java │ │ ├── DropColConverterTest.java │ │ ├── DropPrimaryConstraintConverterTest.java │ │ └── DropTableConverterTest.java │ │ └── util │ │ └── FmlTableUtilTest.java ├── fastmodel-converter-examples │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── converter │ │ └── examples │ │ └── DemoConverterTest.java ├── fastmodel-converter-spi │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── converter │ │ ├── spi │ │ ├── BaseConverterFactory.java │ │ ├── BaseStatementConverter.java │ │ ├── ConvertContext.java │ │ └── StatementConverter.java │ │ └── util │ │ └── GenericTypeUtil.java └── pom.xml ├── fastmodel-core ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── core │ │ ├── exception │ │ ├── ParseException.java │ │ ├── ParserNotFoundException.java │ │ ├── PropertyConvertException.java │ │ ├── RewriteException.java │ │ └── SemanticException.java │ │ ├── formatter │ │ ├── ExpressionFormatter.java │ │ ├── ExpressionVisitor.java │ │ ├── FastModelFormatter.java │ │ └── FastModelVisitor.java │ │ ├── parser │ │ ├── DomainLanguage.java │ │ ├── FastModelParser.java │ │ ├── FastModelParserFactory.java │ │ └── LanguageParser.java │ │ ├── semantic │ │ ├── SemanticCheck.java │ │ ├── SemanticErrorCode.java │ │ └── table │ │ │ ├── CreateTableSemanticCheck.java │ │ │ ├── DimConstraintSemanticCheck.java │ │ │ ├── LevelConstraintSemanticCheck.java │ │ │ └── PrimaryConstraintSemanticCheck.java │ │ └── tree │ │ ├── AbstractFmlNode.java │ │ ├── AbstractNode.java │ │ ├── AliasedName.java │ │ ├── AstVisitor.java │ │ ├── BaseFmlStatement.java │ │ ├── BaseRelation.java │ │ ├── BaseStatement.java │ │ ├── Comment.java │ │ ├── IAstVisitor.java │ │ ├── IStatementType.java │ │ ├── ListNode.java │ │ ├── Node.java │ │ ├── NodeLocation.java │ │ ├── Property.java │ │ ├── QualifiedName.java │ │ ├── datatype │ │ ├── BaseDataType.java │ │ ├── DataTypeEnums.java │ │ ├── DataTypeParameter.java │ │ ├── Field.java │ │ ├── GenericDataType.java │ │ ├── IDataTypeName.java │ │ ├── JsonDataType.java │ │ ├── NumericParameter.java │ │ ├── RowDataType.java │ │ ├── TypeParameter.java │ │ └── VariableDataTypeName.java │ │ ├── expr │ │ ├── AllRows.java │ │ ├── ArithmeticBinaryExpression.java │ │ ├── ArithmeticUnaryExpression.java │ │ ├── BaseExpression.java │ │ ├── BitOperationExpression.java │ │ ├── ComparisonExpression.java │ │ ├── CustomExpression.java │ │ ├── DereferenceExpression.java │ │ ├── Identifier.java │ │ ├── IsConditionExpression.java │ │ ├── LogicalBinaryExpression.java │ │ ├── Parameter.java │ │ ├── Row.java │ │ ├── atom │ │ │ ├── Cast.java │ │ │ ├── CoalesceExpression.java │ │ │ ├── ExistsPredicate.java │ │ │ ├── Extract.java │ │ │ ├── Floor.java │ │ │ ├── FunctionCall.java │ │ │ ├── GroupingOperation.java │ │ │ ├── IfExpression.java │ │ │ ├── InPredicate.java │ │ │ ├── IntervalExpression.java │ │ │ ├── LambdaExpression.java │ │ │ ├── ListExpression.java │ │ │ ├── SearchedCaseExpression.java │ │ │ ├── SimpleCaseExpression.java │ │ │ ├── SubQueryExpression.java │ │ │ ├── TableOrColumn.java │ │ │ └── WhenClause.java │ │ ├── enums │ │ │ ├── ArithmeticOperator.java │ │ │ ├── BitOperator.java │ │ │ ├── ComparisonOperator.java │ │ │ ├── DateTimeEnum.java │ │ │ ├── DistinctOrAll.java │ │ │ ├── FrameBoundType.java │ │ │ ├── IntegralLiteralSuffix.java │ │ │ ├── IntervalQualifiers.java │ │ │ ├── IsType.java │ │ │ ├── LikeCondition.java │ │ │ ├── LikeOperator.java │ │ │ ├── LogicalOperator.java │ │ │ ├── NullTreatment.java │ │ │ ├── Sign.java │ │ │ ├── VarType.java │ │ │ └── WindowFrameType.java │ │ ├── literal │ │ │ ├── BaseLiteral.java │ │ │ ├── BooleanLiteral.java │ │ │ ├── CurrentDate.java │ │ │ ├── CurrentTimestamp.java │ │ │ ├── DateLiteral.java │ │ │ ├── DecimalLiteral.java │ │ │ ├── DoubleLiteral.java │ │ │ ├── EscapeStringLiteral.java │ │ │ ├── HexLiteral.java │ │ │ ├── IntervalLiteral.java │ │ │ ├── ListStringLiteral.java │ │ │ ├── LongLiteral.java │ │ │ ├── NullLiteral.java │ │ │ ├── StringLiteral.java │ │ │ ├── TimestampLiteral.java │ │ │ └── TimestampLocalTzLiteral.java │ │ ├── similar │ │ │ ├── BetweenPredicate.java │ │ │ ├── InListExpression.java │ │ │ ├── LikePredicate.java │ │ │ └── NotExpression.java │ │ └── window │ │ │ ├── FrameBound.java │ │ │ ├── Window.java │ │ │ └── WindowFrame.java │ │ ├── relation │ │ ├── AliasedRelation.java │ │ ├── Join.java │ │ ├── Lateral.java │ │ ├── SampledRelation.java │ │ ├── SampledType.java │ │ ├── join │ │ │ ├── JoinCriteria.java │ │ │ ├── JoinOn.java │ │ │ ├── JoinToken.java │ │ │ ├── JoinUsing.java │ │ │ └── NaturalJoin.java │ │ └── querybody │ │ │ ├── BaseQueryBody.java │ │ │ ├── Except.java │ │ │ ├── Intersect.java │ │ │ ├── QuerySpecification.java │ │ │ ├── SetOperation.java │ │ │ ├── Table.java │ │ │ ├── TableSubQuery.java │ │ │ ├── Union.java │ │ │ └── Values.java │ │ ├── statement │ │ ├── BaseCommandStatement.java │ │ ├── BaseCreate.java │ │ ├── BaseDrop.java │ │ ├── BaseOperatorStatement.java │ │ ├── BaseQueryStatement.java │ │ ├── BaseRename.java │ │ ├── BaseSetAliasedName.java │ │ ├── BaseSetComment.java │ │ ├── BaseSetProperties.java │ │ ├── BaseUnSetProperties.java │ │ ├── CompositeStatement.java │ │ ├── adjunct │ │ │ ├── CreateAdjunct.java │ │ │ ├── DropAdjunct.java │ │ │ ├── RenameAdjunct.java │ │ │ ├── SetAdjunctAlias.java │ │ │ ├── SetAdjunctComment.java │ │ │ └── SetAdjunctProperties.java │ │ ├── batch │ │ │ ├── AbstractBatchElement.java │ │ │ ├── CreateBatchDomain.java │ │ │ ├── CreateBatchNamingDict.java │ │ │ ├── CreateIndicatorBatch.java │ │ │ └── element │ │ │ │ ├── DateField.java │ │ │ │ ├── DefaultAdjunct.java │ │ │ │ ├── DimPathElement.java │ │ │ │ ├── DimTableElement.java │ │ │ │ ├── DomainElement.java │ │ │ │ ├── FromTableElement.java │ │ │ │ ├── IndicatorDefine.java │ │ │ │ ├── NamingDictElement.java │ │ │ │ ├── TableList.java │ │ │ │ └── TimePeriodElement.java │ │ ├── businesscategory │ │ │ ├── CreateBusinessCategory.java │ │ │ ├── DropBusinessCategory.java │ │ │ ├── RenameBusinessCategory.java │ │ │ ├── SetBusinessCategoryAlias.java │ │ │ ├── SetBusinessCategoryComment.java │ │ │ ├── SetBusinessCategoryProperties.java │ │ │ └── UnSetBusinessCategoryProperties.java │ │ ├── businessprocess │ │ │ ├── CreateBusinessProcess.java │ │ │ ├── DropBusinessProcess.java │ │ │ ├── RenameBusinessProcess.java │ │ │ ├── SetBusinessProcessAlias.java │ │ │ ├── SetBusinessProcessComment.java │ │ │ ├── SetBusinessProcessProperties.java │ │ │ └── UnSetBusinessProcessProperties.java │ │ ├── businessunit │ │ │ ├── CreateBusinessUnit.java │ │ │ ├── SetBusinessUnitAlias.java │ │ │ └── SetBusinessUnitComment.java │ │ ├── command │ │ │ ├── ExportSql.java │ │ │ ├── FormatFml.java │ │ │ ├── HelpCommand.java │ │ │ └── ImportSql.java │ │ ├── constants │ │ │ ├── ColumnCategory.java │ │ │ ├── ColumnPropertyDefaultKey.java │ │ │ ├── ConstraintScope.java │ │ │ ├── ConstraintType.java │ │ │ ├── DeleteType.java │ │ │ ├── IndicatorType.java │ │ │ ├── MaterializedType.java │ │ │ ├── ShowObjectsType.java │ │ │ ├── ShowType.java │ │ │ ├── StatementType.java │ │ │ ├── TableDetailType.java │ │ │ └── TableType.java │ │ ├── delete │ │ │ └── Delete.java │ │ ├── desc │ │ │ └── Describe.java │ │ ├── dict │ │ │ ├── CreateDict.java │ │ │ ├── DropDict.java │ │ │ ├── RenameDict.java │ │ │ ├── SetDictAlias.java │ │ │ ├── SetDictComment.java │ │ │ └── SetDictProperties.java │ │ ├── dimension │ │ │ ├── AddDimensionAttribute.java │ │ │ ├── ChangeDimensionAttribute.java │ │ │ ├── CreateDimension.java │ │ │ ├── DropDimension.java │ │ │ ├── DropDimensionAttribute.java │ │ │ ├── RenameDimension.java │ │ │ ├── SetDimensionAlias.java │ │ │ ├── SetDimensionComment.java │ │ │ ├── SetDimensionProperties.java │ │ │ ├── UnSetDimensionProperties.java │ │ │ └── attribute │ │ │ │ ├── AttributeCategory.java │ │ │ │ └── DimensionAttribute.java │ │ ├── domain │ │ │ ├── CreateDomain.java │ │ │ ├── DropDomain.java │ │ │ ├── RenameDomain.java │ │ │ ├── SetDomainAlias.java │ │ │ ├── SetDomainComment.java │ │ │ ├── SetDomainProperties.java │ │ │ └── UnSetDomainProperties.java │ │ ├── dqc │ │ │ ├── AddDqcRule.java │ │ │ ├── ChangeDqcRule.java │ │ │ ├── ChangeDqcRuleElement.java │ │ │ ├── CreateDqcRule.java │ │ │ ├── DropDqcRule.java │ │ │ └── check │ │ │ │ ├── BaseCheckElement.java │ │ │ │ └── TableCheckElement.java │ │ ├── element │ │ │ ├── CreateElement.java │ │ │ └── MultiComment.java │ │ ├── group │ │ │ ├── CreateGroup.java │ │ │ ├── DropGroup.java │ │ │ ├── GroupType.java │ │ │ ├── SetGroupAlias.java │ │ │ ├── SetGroupComment.java │ │ │ └── SetGroupProperties.java │ │ ├── impexp │ │ │ └── ExportStatement.java │ │ ├── indicator │ │ │ ├── CreateAtomicCompositeIndicator.java │ │ │ ├── CreateAtomicIndicator.java │ │ │ ├── CreateDerivativeCompositeIndicator.java │ │ │ ├── CreateDerivativeIndicator.java │ │ │ ├── CreateIndicator.java │ │ │ ├── DropIndicator.java │ │ │ ├── RenameIndicator.java │ │ │ ├── SetIndicatorAlias.java │ │ │ ├── SetIndicatorComment.java │ │ │ └── SetIndicatorProperties.java │ │ ├── insert │ │ │ └── Insert.java │ │ ├── layer │ │ │ ├── AddChecker.java │ │ │ ├── Checker.java │ │ │ ├── CheckerType.java │ │ │ ├── CreateLayer.java │ │ │ ├── DropChecker.java │ │ │ ├── DropLayer.java │ │ │ ├── RenameLayer.java │ │ │ ├── SetLayerAlias.java │ │ │ ├── SetLayerComment.java │ │ │ └── SetLayerProperties.java │ │ ├── market │ │ │ ├── CreateMarket.java │ │ │ ├── DropMarket.java │ │ │ ├── RenameMarket.java │ │ │ ├── SetMarketAlias.java │ │ │ ├── SetMarketComment.java │ │ │ ├── SetMarketProperties.java │ │ │ └── UnSetMarketProperties.java │ │ ├── materialize │ │ │ ├── CreateMaterialize.java │ │ │ ├── DropMaterialize.java │ │ │ ├── RenameMaterialize.java │ │ │ ├── SetMaterializeAlias.java │ │ │ ├── SetMaterializeComment.java │ │ │ └── SetMaterializeRefProperties.java │ │ ├── measure │ │ │ └── unit │ │ │ │ ├── CreateMeasureUnit.java │ │ │ │ ├── DropMeasureUnit.java │ │ │ │ ├── RenameMeasureUnit.java │ │ │ │ ├── SetMeasureUnitAlias.java │ │ │ │ ├── SetMeasureUnitComment.java │ │ │ │ └── SetMeasureUnitProperties.java │ │ ├── misc │ │ │ ├── Call.java │ │ │ ├── EmptyStatement.java │ │ │ └── Use.java │ │ ├── pipe │ │ │ ├── CopyMode.java │ │ │ ├── CreatePipe.java │ │ │ ├── PipeCopyInto.java │ │ │ ├── PipeFrom.java │ │ │ ├── PipeType.java │ │ │ └── TargetType.java │ │ ├── references │ │ │ ├── MoveReferences.java │ │ │ └── ShowReferences.java │ │ ├── rule │ │ │ ├── AddRules.java │ │ │ ├── ChangeRuleElement.java │ │ │ ├── ChangeRules.java │ │ │ ├── CreateRules.java │ │ │ ├── DropRule.java │ │ │ ├── PartitionSpec.java │ │ │ ├── RuleDefinition.java │ │ │ ├── RuleGrade.java │ │ │ ├── RuleStrategy.java │ │ │ ├── RulesLevel.java │ │ │ ├── function │ │ │ │ ├── BaseFunction.java │ │ │ │ ├── BaseFunctionName.java │ │ │ │ ├── FunctionGrade.java │ │ │ │ ├── VolFunction.java │ │ │ │ ├── column │ │ │ │ │ ├── ColumnFunction.java │ │ │ │ │ └── InTableFunction.java │ │ │ │ └── table │ │ │ │ │ └── TableFunction.java │ │ │ └── strategy │ │ │ │ ├── DynamicStrategy.java │ │ │ │ ├── FixedStrategy.java │ │ │ │ ├── StrategyUtil.java │ │ │ │ ├── VolInterval.java │ │ │ │ ├── VolOperator.java │ │ │ │ └── VolStrategy.java │ │ ├── script │ │ │ ├── ImportObject.java │ │ │ ├── RefDirection.java │ │ │ ├── RefObject.java │ │ │ └── RefRelation.java │ │ ├── select │ │ │ ├── FetchFirst.java │ │ │ ├── Hint.java │ │ │ ├── Limit.java │ │ │ ├── Offset.java │ │ │ ├── Query.java │ │ │ ├── RowToCol.java │ │ │ ├── Select.java │ │ │ ├── With.java │ │ │ ├── WithQuery.java │ │ │ ├── groupby │ │ │ │ ├── Cube.java │ │ │ │ ├── GroupBy.java │ │ │ │ ├── GroupingElement.java │ │ │ │ ├── GroupingSets.java │ │ │ │ ├── Rollup.java │ │ │ │ └── SimpleGroupBy.java │ │ │ ├── item │ │ │ │ ├── AllColumns.java │ │ │ │ ├── SelectItem.java │ │ │ │ └── SingleColumn.java │ │ │ ├── order │ │ │ │ ├── NullOrdering.java │ │ │ │ ├── OrderBy.java │ │ │ │ ├── Ordering.java │ │ │ │ └── SortItem.java │ │ │ └── sort │ │ │ │ ├── ClusterBy.java │ │ │ │ ├── DistributeBy.java │ │ │ │ └── SortBy.java │ │ ├── show │ │ │ ├── ConditionElement.java │ │ │ ├── LikeCondition.java │ │ │ ├── ShowObjects.java │ │ │ ├── ShowSingleStatistic.java │ │ │ ├── ShowStatistic.java │ │ │ └── WhereCondition.java │ │ ├── showcreate │ │ │ ├── Output.java │ │ │ └── ShowCreate.java │ │ ├── subject │ │ │ ├── CreateSubject.java │ │ │ ├── DropSubject.java │ │ │ ├── RenameSubject.java │ │ │ ├── SetSubjectAlias.java │ │ │ ├── SetSubjectComment.java │ │ │ ├── SetSubjectProperties.java │ │ │ └── UnSetSubjectProperties.java │ │ ├── table │ │ │ ├── AddCols.java │ │ │ ├── AddConstraint.java │ │ │ ├── AddPartitionCol.java │ │ │ ├── ChangeCol.java │ │ │ ├── CloneTable.java │ │ │ ├── ColumnDefinition.java │ │ │ ├── CreateAdsTable.java │ │ │ ├── CreateCodeTable.java │ │ │ ├── CreateDimTable.java │ │ │ ├── CreateDwsTable.java │ │ │ ├── CreateFactTable.java │ │ │ ├── CreateIndex.java │ │ │ ├── CreateOdsTable.java │ │ │ ├── CreateTable.java │ │ │ ├── DropCol.java │ │ │ ├── DropConstraint.java │ │ │ ├── DropIndex.java │ │ │ ├── DropPartitionCol.java │ │ │ ├── DropTable.java │ │ │ ├── PartitionedBy.java │ │ │ ├── RenameCol.java │ │ │ ├── RenameTable.java │ │ │ ├── SetColComment.java │ │ │ ├── SetColProperties.java │ │ │ ├── SetColumnOrder.java │ │ │ ├── SetTableAliasedName.java │ │ │ ├── SetTableComment.java │ │ │ ├── SetTableProperties.java │ │ │ ├── TableElement.java │ │ │ ├── UnSetColProperties.java │ │ │ ├── UnSetTableProperties.java │ │ │ ├── constraint │ │ │ │ ├── BaseConstraint.java │ │ │ │ ├── ColumnGroupConstraint.java │ │ │ │ ├── CustomConstraint.java │ │ │ │ ├── DefaultValueConstraint.java │ │ │ │ ├── DimConstraint.java │ │ │ │ ├── LevelConstraint.java │ │ │ │ ├── LevelDefine.java │ │ │ │ ├── NotNullConstraint.java │ │ │ │ ├── PrimaryConstraint.java │ │ │ │ ├── RedundantConstraint.java │ │ │ │ ├── TimePeriodConstraint.java │ │ │ │ └── UniqueConstraint.java │ │ │ ├── index │ │ │ │ ├── IndexColumnName.java │ │ │ │ ├── IndexExpr.java │ │ │ │ ├── IndexSortKey.java │ │ │ │ ├── SortType.java │ │ │ │ └── TableIndex.java │ │ │ └── type │ │ │ │ ├── ITableDetailType.java │ │ │ │ └── ITableType.java │ │ └── timeperiod │ │ │ ├── CreateTimePeriod.java │ │ │ ├── DropTimePeriod.java │ │ │ ├── RenameTimePeriod.java │ │ │ ├── SetTimePeriodAlias.java │ │ │ ├── SetTimePeriodComment.java │ │ │ └── SetTimePeriodProperties.java │ │ └── util │ │ ├── DataTypeUtil.java │ │ ├── EngineUrlStreamHandler.java │ │ ├── ExpressionUtil.java │ │ ├── IdentifierUtil.java │ │ ├── PropertyUtil.java │ │ ├── QueryUtil.java │ │ ├── RuleUtil.java │ │ ├── StringLiteralUtil.java │ │ └── UnderLineUtils.java │ └── test │ └── java │ └── com │ └── aliyun │ └── fastmodel │ └── core │ ├── formatter │ ├── ExpressionVisitorTest.java │ ├── FastModelFormatterTest.java │ └── FastModelVisitorTest.java │ ├── parser │ └── FastModelParserFactoryTest.java │ ├── semantic │ ├── CreateTableSemanticCheckTest.java │ └── table │ │ ├── DimConstraintSemanticCheckTest.java │ │ ├── LevelConstraintSemanticCheckTest.java │ │ └── PrimaryConstraintSemanticCheckTest.java │ ├── shared │ └── constants │ │ ├── ConstraintTypeTest.java │ │ ├── IndicatorTypeTest.java │ │ ├── StatementTypeTest.java │ │ ├── TableDetailTypeTest.java │ │ └── TableTypeTest.java │ ├── statement │ ├── bp │ │ └── alter │ │ │ └── SetBpCommentStatementTest.java │ ├── expr │ │ ├── atom │ │ │ ├── SimpleCaseExpressionTest.java │ │ │ ├── TableOrColumnTest.java │ │ │ └── constant │ │ │ │ └── TimestampLiteralTest.java │ │ └── similar │ │ │ └── LikePredicateTest.java │ ├── select │ │ └── QueryStatementTest.java │ └── table │ │ └── alter │ │ ├── RenameTableStatementTest.java │ │ └── UnSetTablePropertiesStatementTest.java │ └── tree │ ├── QualifiedNameTest.java │ ├── TestAstVisitor.java │ ├── expr │ ├── AllRowsTest.java │ ├── BitOperationExpressionTest.java │ ├── ComparisonExpressionTest.java │ ├── DereferenceExpressionTest.java │ ├── ExpressionFormatterTest.java │ ├── IsTypeExpressionTest.java │ ├── LogicalBinaryExpressionTest.java │ ├── atom │ │ ├── CastTest.java │ │ ├── CoalesceExpressionTest.java │ │ ├── ExtractTest.java │ │ ├── FloorTest.java │ │ ├── FunctionCallTest.java │ │ └── SearchedCaseExpressionTest.java │ ├── similar │ │ ├── InListExpressionTest.java │ │ └── NotExpressionTest.java │ └── window │ │ └── WindowTest.java │ ├── relation │ └── LateralTest.java │ ├── statement │ ├── BaseOperatorStatementTest.java │ ├── StatementAcceptTest.java │ ├── adjunct │ │ ├── CreateAdjunctTest.java │ │ ├── DropAdjunctTest.java │ │ └── RenameAdjunctTest.java │ ├── businessunit │ │ ├── CreateBusinessUnitTest.java │ │ └── SetBusinessUnitCommentTest.java │ ├── constants │ │ └── ShowObjectsTypeTest.java │ ├── desc │ │ └── DescribeTest.java │ ├── indicator │ │ ├── CreateAtomicCompositeIndicatorTest.java │ │ ├── CreateAtomicIndicatorTest.java │ │ ├── CreateDerivativeCompositeIndicatorTest.java │ │ └── CreateDerivativeIndicatorTest.java │ ├── select │ │ └── item │ │ │ ├── AllColumnsTest.java │ │ │ └── SingleColumnTest.java │ └── table │ │ ├── ChangeColTest.java │ │ ├── CreateDimTableTest.java │ │ ├── DropTableTest.java │ │ └── constraint │ │ ├── DefaultValueConstraintTest.java │ │ └── RedundantConstraintTest.java │ └── util │ ├── DataTypeUtilTest.java │ ├── EngineUrlStreamHandlerTest.java │ ├── ExpressionUtilsTest.java │ ├── IdentifierUtilTest.java │ ├── PropertyUtilTest.java │ ├── QueryUtilTest.java │ └── RuleUtilTest.java ├── fastmodel-dependencies-bom └── pom.xml ├── fastmodel-driver ├── fastmodel-driver-cli │ ├── pom.xml │ └── src │ │ ├── assembly │ │ └── assembly.xml │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── driver │ │ │ │ └── cli │ │ │ │ ├── FastModel.java │ │ │ │ ├── command │ │ │ │ ├── ClientOptions.java │ │ │ │ ├── Console.java │ │ │ │ └── Help.java │ │ │ │ └── terminal │ │ │ │ ├── Completion.java │ │ │ │ ├── InputHighlighter.java │ │ │ │ ├── InputParser.java │ │ │ │ ├── QueryRunner.java │ │ │ │ ├── TerminalUtils.java │ │ │ │ └── printer │ │ │ │ ├── AlignedTablePrinter.java │ │ │ │ ├── DumpFilePrinter.java │ │ │ │ ├── DumpInfo.java │ │ │ │ └── OutputPrinter.java │ │ └── resources │ │ │ ├── README.md │ │ │ ├── fml_config.properties │ │ │ └── start.sh │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── driver │ │ │ └── cli │ │ │ ├── FastModelTest.java │ │ │ ├── command │ │ │ ├── ClientOptionsTest.java │ │ │ ├── ConsoleTest.java │ │ │ └── HelpTest.java │ │ │ └── terminal │ │ │ ├── CompletionTest.java │ │ │ ├── InputHighlighterTest.java │ │ │ ├── InputParserTest.java │ │ │ ├── QueryRunnerTest.java │ │ │ ├── TerminalUtilsTest.java │ │ │ └── printer │ │ │ ├── AlignedTablePrinterTest.java │ │ │ └── DumpFilePrinterTest.java │ │ └── resources │ │ └── test.http ├── fastmodel-driver-client │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── driver │ │ │ └── client │ │ │ ├── FastModelEngineConnection.java │ │ │ ├── FastModelEngineDriver.java │ │ │ ├── FastModelEnginePrepareStatement.java │ │ │ ├── FastModelEngineStatement.java │ │ │ ├── FastModelResultSet.java │ │ │ ├── FastModelUrlParser.java │ │ │ ├── command │ │ │ ├── BaseCommandProperties.java │ │ │ ├── CommandFactory.java │ │ │ ├── ExecuteCommand.java │ │ │ └── SslMode.java │ │ │ ├── exception │ │ │ ├── CommandException.java │ │ │ ├── FastModelException.java │ │ │ ├── IllegalConfigException.java │ │ │ ├── ResultContainErrorException.java │ │ │ └── ResultParseException.java │ │ │ ├── metadata │ │ │ ├── FastModelDataBaseMetadata.java │ │ │ └── FastModelResultSetMetaData.java │ │ │ ├── request │ │ │ ├── FastModelRequestBody.java │ │ │ └── FastModelWrapperResponse.java │ │ │ └── utils │ │ │ ├── FastModelResultSetBuilder.java │ │ │ ├── RequestIdUtils.java │ │ │ ├── Version.java │ │ │ └── ssl │ │ │ └── NonValidatingTrustManager.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── driver │ │ └── client │ │ ├── FastModelEngineConnectionTest.java │ │ ├── FastModelEngineDriverTest.java │ │ ├── FastModelEnginePrepareStatementTest.java │ │ ├── FastModelEngineStatementTest.java │ │ ├── FastModelResultSetTest.java │ │ ├── FastModelUrlParserTest.java │ │ ├── command │ │ └── sample │ │ │ ├── SampleCommandFactory.java │ │ │ ├── SampleCommandProperties.java │ │ │ └── SampleExecuteCommand.java │ │ ├── exception │ │ └── FastModelExceptionTest.java │ │ ├── metadata │ │ ├── FastModelDataBaseMetadataTest.java │ │ └── FastModelResultSetMetaDataTest.java │ │ └── utils │ │ ├── FastModelResultSetBuilderTest.java │ │ └── ssl │ │ └── NonValidatingTrustManagerTest.java ├── fastmodel-driver-model │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── driver │ │ │ └── model │ │ │ ├── DriverColumnInfo.java │ │ │ ├── DriverDataType.java │ │ │ ├── DriverResult.java │ │ │ ├── DriverRow.java │ │ │ ├── DriverUtil.java │ │ │ └── QueryResult.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── driver │ │ └── model │ │ ├── DriverDataTypeTest.java │ │ └── DriverUtilTest.java ├── fastmodel-driver-server │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── driver │ │ │ │ └── server │ │ │ │ ├── FastModelHttpHandler.java │ │ │ │ ├── MyHandler.java │ │ │ │ ├── ResultWrapper.java │ │ │ │ ├── SimpleHttp.java │ │ │ │ ├── SimpleHttpsServer.java │ │ │ │ ├── command │ │ │ │ ├── Command.java │ │ │ │ ├── CommandFactory.java │ │ │ │ ├── CreateTableCommand.java │ │ │ │ ├── FmlCommand.java │ │ │ │ └── ShowObjectCommand.java │ │ │ │ ├── druid │ │ │ │ └── DruidDemo.java │ │ │ │ ├── mock │ │ │ │ ├── MockCommandFactory.java │ │ │ │ ├── MockCommandProperties.java │ │ │ │ ├── MockExecuteCommand.java │ │ │ │ └── SampleHttpClientBuilder.java │ │ │ │ ├── mybatis │ │ │ │ ├── ShowTables.java │ │ │ │ └── ShowTablesMapper.java │ │ │ │ └── websocket │ │ │ │ ├── FastModelWebSocketClient.java │ │ │ │ ├── FastModelWebSocketServer.java │ │ │ │ ├── ImagePanel.java │ │ │ │ └── model │ │ │ │ ├── Message.java │ │ │ │ └── MessageAction.java │ │ └── resources │ │ │ ├── keytool_https.sh │ │ │ ├── lig.keystore │ │ │ ├── mybatis │ │ │ ├── mapper │ │ │ │ └── ShowTablesMapper.xml │ │ │ └── mybatis-config.xml │ │ │ └── nopic.jpg │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── driver │ │ └── server │ │ ├── DriverBaseTest.java │ │ ├── DriverTest.java │ │ ├── FastModelHttpHandlerTest.java │ │ ├── druid │ │ └── DruidDemoTest.java │ │ └── mybatis │ │ └── ShowTablesMapperTest.java └── pom.xml ├── fastmodel-ide ├── fastmodel-ide-open-front │ ├── .gitignore │ ├── README.md │ ├── antlr │ │ ├── FastModelGrammarParser.g4 │ │ └── FastModelLexer.g4 │ ├── package.json │ ├── pom.xml │ ├── src │ │ ├── components │ │ │ ├── editor │ │ │ │ └── Editor.tsx │ │ │ ├── fmlgraph │ │ │ │ ├── FmlGraph.tsx │ │ │ │ ├── GraphConfig.ts │ │ │ │ └── GraphNode.ts │ │ │ └── toolbar │ │ │ │ └── ToolBar.tsx │ │ ├── constants │ │ │ ├── models.ts │ │ │ └── server.ts │ │ ├── fastmodel │ │ │ ├── DiagnosticsAdapter.ts │ │ │ ├── FastModelLang.ts │ │ │ ├── FastModelLangFormattingProvider.ts │ │ │ ├── FastModelLangHoverProvider.ts │ │ │ ├── WorkerManager.ts │ │ │ ├── config.ts │ │ │ ├── fastmodel.worker.ts │ │ │ ├── fastmodelWorker.ts │ │ │ └── setup.ts │ │ ├── index.html │ │ ├── index.tsx │ │ └── language-service │ │ │ ├── FastModelParser.ts │ │ │ ├── LangErrorListener.ts │ │ │ └── LanguageService.ts │ ├── tsconfig.json │ └── webpack.config.js ├── fastmodel-ide-open │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── ide │ │ │ │ └── open │ │ │ │ ├── extension │ │ │ │ ├── OpenIdeCommandProvider.java │ │ │ │ ├── OpenIdePlatform.java │ │ │ │ └── command │ │ │ │ │ ├── HelpKeyWordCommand.java │ │ │ │ │ └── RenderPlantUmlIdeCommand.java │ │ │ │ ├── service │ │ │ │ ├── StorageService.java │ │ │ │ └── impl │ │ │ │ │ └── FileStorageServiceImpl.java │ │ │ │ ├── start │ │ │ │ ├── EngineApplication.java │ │ │ │ ├── configuration │ │ │ │ │ ├── BeanConfiguration.java │ │ │ │ │ ├── CustomeMimeMapping.java │ │ │ │ │ └── WebConfiguration.java │ │ │ │ ├── constants │ │ │ │ │ └── ApiConstant.java │ │ │ │ ├── controller │ │ │ │ │ ├── CommandController.java │ │ │ │ │ └── IndexMenuController.java │ │ │ │ ├── error │ │ │ │ │ └── WebExceptionHandler.java │ │ │ │ └── model │ │ │ │ │ ├── context │ │ │ │ │ ├── DefaultInvokeContext.java │ │ │ │ │ └── TransformInvokeContext.java │ │ │ │ │ └── dto │ │ │ │ │ ├── ExportParamDTO.java │ │ │ │ │ ├── FmlParamDTO.java │ │ │ │ │ ├── IParam.java │ │ │ │ │ └── ImportParamDTO.java │ │ │ │ └── util │ │ │ │ └── I18nHelper.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── ascli.sh │ │ │ ├── i18n │ │ │ ├── messages.properties │ │ │ ├── messages_en_US.properties │ │ │ └── messages_zh_CN.properties │ │ │ ├── logback.xml │ │ │ ├── static │ │ │ ├── editor.worker.js │ │ │ ├── fastmodelWorker.js │ │ │ └── js │ │ │ │ └── fml │ │ │ │ └── bundle.js │ │ │ └── templates │ │ │ └── fml.html │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── ide │ │ └── open │ │ ├── command │ │ └── RenderPlantUmlIdeCommandTest.java │ │ ├── extension │ │ └── command │ │ │ └── HelpKeyWordCommandTest.java │ │ └── provider │ │ └── OpenIdeCommandProviderTest.java ├── fastmodel-ide-spi │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── ide │ │ └── spi │ │ ├── command │ │ ├── BaseIdeCommand.java │ │ ├── CommandProvider.java │ │ ├── DefaultCommandProvider.java │ │ ├── ExportSqlIdeCommand.java │ │ ├── FormatIdeCommand.java │ │ ├── IdeCommand.java │ │ └── ImportSqlIdeCommand.java │ │ ├── exception │ │ ├── BaseIdeException.java │ │ ├── CommandExecuteException.java │ │ ├── CommandProviderGetException.java │ │ ├── PlatformException.java │ │ └── error │ │ │ ├── IErrorCode.java │ │ │ ├── IdeErrorCode.java │ │ │ └── PlatformErrorCode.java │ │ ├── invoker │ │ ├── DefaultIdeInvoker.java │ │ ├── IdeInvoker.java │ │ └── InvokeResult.java │ │ ├── params │ │ ├── DefaultOptions.java │ │ ├── DocumentFormatParams.java │ │ ├── FmlParams.java │ │ ├── Options.java │ │ └── Params.java │ │ └── receiver │ │ ├── DocumentService.java │ │ ├── IdePlatform.java │ │ ├── ToolService.java │ │ └── impl │ │ ├── DefaultDocumentServiceImpl.java │ │ └── DefaultToolServiceImpl.java └── pom.xml ├── fastmodel-jacoco └── pom.xml ├── fastmodel-parser ├── pom.xml └── src │ ├── main │ ├── antlr4 │ │ ├── com │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── parser │ │ │ │ └── generate │ │ │ │ ├── FastModelGrammarParser.g4 │ │ │ │ └── FastModelLexer.g4 │ │ └── imports │ │ │ ├── AdjunctParser.g4 │ │ │ ├── BatchParser.g4 │ │ │ ├── BusinessCategoryParser.g4 │ │ │ ├── BusinessProcessParser.g4 │ │ │ ├── BusinessUnitParser.g4 │ │ │ ├── CallParser.g4 │ │ │ ├── CommandParser.g4 │ │ │ ├── DictParser.g4 │ │ │ ├── DimensionParser.g4 │ │ │ ├── DomainParser.g4 │ │ │ ├── DqcRule.g4 │ │ │ ├── GroupParser.g4 │ │ │ ├── ImpExpParser.g4 │ │ │ ├── IndicatorParser.g4 │ │ │ ├── LayerParser.g4 │ │ │ ├── MaterializeParser.g4 │ │ │ ├── MeasureUnitParser.g4 │ │ │ ├── PipeParser.g4 │ │ │ ├── QueryParser.g4 │ │ │ ├── ReferencesParser.g4 │ │ │ ├── Rules.g4 │ │ │ ├── ScriptParser.g4 │ │ │ ├── ShowParser.g4 │ │ │ ├── TableParser.g4 │ │ │ └── TimePeriodParser.g4 │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── parser │ │ ├── AstBuilder.java │ │ ├── NodeParser.java │ │ ├── StatementSplitter.java │ │ ├── annotation │ │ └── SubVisitor.java │ │ ├── lexer │ │ ├── CaseChangingCharStream.java │ │ ├── DelimiterLexer.java │ │ └── ReservedIdentifier.java │ │ └── visitor │ │ ├── AdjunctVisitor.java │ │ ├── AstExtractVisitor.java │ │ ├── BatchVisitor.java │ │ ├── BusinessCategoryVisitor.java │ │ ├── BusinessProcessVisitor.java │ │ ├── BusinessUnitVisitor.java │ │ ├── CallVisitor.java │ │ ├── CommandVisitor.java │ │ ├── DescribeVisitor.java │ │ ├── DictVisitor.java │ │ ├── DimensionVisitor.java │ │ ├── DomainVisitor.java │ │ ├── DqcRuleVisitor.java │ │ ├── GroupVisitor.java │ │ ├── ImpExpVisitor.java │ │ ├── IndicatorVisitor.java │ │ ├── LayerVisitor.java │ │ ├── MaterializeVisitor.java │ │ ├── MeasureUnitVisitor.java │ │ ├── PipeVisitor.java │ │ ├── QueryVisitor.java │ │ ├── ReferencesVisitor.java │ │ ├── RuleVisitor.java │ │ ├── ScriptVisitor.java │ │ ├── ShowVisitor.java │ │ ├── TableColumnVisitor.java │ │ ├── TableVisitor.java │ │ ├── TimePeriodVisitor.java │ │ ├── UseVisitor.java │ │ └── param │ │ └── TableParamObject.java │ └── test │ ├── java │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── parser │ │ ├── BaseTest.java │ │ ├── DelimiterLexerTest.java │ │ ├── NodeParserTest.java │ │ ├── ReservedIdentifierTest.java │ │ ├── StatementSplitterTest.java │ │ ├── convert │ │ ├── BaseConvertUtil.java │ │ ├── ConvertLexerUtilTest.java │ │ ├── ConvertParserUtilTest.java │ │ └── KeyWordsGeneratorTest.java │ │ ├── expr │ │ ├── DataTypeTest.java │ │ ├── ExpressionFormatTest.java │ │ └── ExpressionTest.java │ │ ├── impl │ │ ├── AddRulesTest.java │ │ ├── AdjunctTest.java │ │ ├── BusinessCategoryTest.java │ │ ├── BusinessProcessTest.java │ │ ├── BusinessUnitTest.java │ │ ├── CallTest.java │ │ ├── CheckTest.java │ │ ├── CodeTableTest.java │ │ ├── ColumnTest.java │ │ ├── CommandTest.java │ │ ├── CompositeStatementTest.java │ │ ├── CreateBatchTest.java │ │ ├── CreateDwsTableTest.java │ │ ├── CreateOdsTableTest.java │ │ ├── DeleteTest.java │ │ ├── DescribeTest.java │ │ ├── DictTest.java │ │ ├── DimensionTest.java │ │ ├── DomainTest.java │ │ ├── DqcRuleTest.java │ │ ├── GroupTest.java │ │ ├── HelpCommandTest.java │ │ ├── ImpExpTest.java │ │ ├── IndexTest.java │ │ ├── IndicatorTest.java │ │ ├── InsertTest.java │ │ ├── LayerTest.java │ │ ├── MarketTest.java │ │ ├── MaterializeTest.java │ │ ├── MeasureUnitTest.java │ │ ├── MultiTest.java │ │ ├── NoReservedTest.java │ │ ├── ParserErrorTest.java │ │ ├── QueryTest.java │ │ ├── ReferencesTest.java │ │ ├── RulesTest.java │ │ ├── ScriptTest.java │ │ ├── ShowCreateTest.java │ │ ├── ShowObjectsTest.java │ │ ├── SubjectTest.java │ │ ├── TableTest.java │ │ ├── TimePeriodTest.java │ │ ├── UseTest.java │ │ └── issue │ │ │ ├── ChangeColumnNpeTest.java │ │ │ ├── StructTest.java │ │ │ └── TableIssueTest.java │ │ ├── pipe │ │ └── CreatePipeTest.java │ │ ├── processor │ │ └── GeneratorSourceTest.java │ │ ├── publish │ │ ├── DslAllTest.java │ │ └── PublishTest.java │ │ ├── statement │ │ ├── InsertTest.java │ │ ├── QueryProcessTest.java │ │ └── QueryTest.java │ │ └── utils │ │ └── ExprUtilsTest.java │ └── resources │ ├── ddl │ └── issue.txt │ ├── dsl-all.txt │ ├── lsp │ ├── FastModelGrammarParser.g4 │ ├── FastModelLexer.g4 │ ├── highlight.json │ └── keyword.txt │ └── publish.sql ├── fastmodel-processor ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── annotation │ │ └── processor │ │ └── AstBuilderProcessor.java │ └── test │ └── java │ └── com │ └── aliyun │ └── fastmodel │ └── annotation │ └── processor │ └── AstBuilderProcessorTest.java ├── fastmodel-transform ├── fastmodel-transform-adbmysql │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── adbmysql │ │ │ │ └── parser │ │ │ │ ├── AdbMysqlLexer.g4 │ │ │ │ └── AdbMysqlParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── adbmysql │ │ │ ├── AdbMysqlTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── client │ │ │ ├── converter │ │ │ │ ├── AdbMysqlClientConverter.java │ │ │ │ └── AdbMysqlPropertyConverter.java │ │ │ └── property │ │ │ │ ├── AdbMysqlBlockSize.java │ │ │ │ ├── AdbMysqlHotPartitionCount.java │ │ │ │ ├── AdbMysqlLifeCycle.java │ │ │ │ └── AdbMysqlStoragePolicy.java │ │ │ ├── context │ │ │ └── AdbMysqlTransformContext.java │ │ │ ├── format │ │ │ ├── AdbMysqlExpressionVisitor.java │ │ │ ├── AdbMysqlOutVisitor.java │ │ │ ├── AdbMysqlPropertyKey.java │ │ │ └── AdbMysqlTimeFunctionType.java │ │ │ └── parser │ │ │ ├── AdbMysqlLanguageParser.java │ │ │ ├── tree │ │ │ ├── AdbMysqlDataTypeName.java │ │ │ ├── datatype │ │ │ │ └── AdbMysqlPointDataType.java │ │ │ └── index │ │ │ │ └── IndexOptionName.java │ │ │ └── visitor │ │ │ ├── AdbMysqlAstBuilder.java │ │ │ └── AdbMysqlAstVisitor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── adbmysql │ │ │ ├── AdbMysqlTransformerTest.java │ │ │ ├── builder │ │ │ └── DefaultBuilderTest.java │ │ │ ├── client │ │ │ ├── AdbMysqlGeneratorClientTest.java │ │ │ ├── AdbMysqlGeneratorTest.java │ │ │ ├── BaseAdbMysqlTest.java │ │ │ ├── converter │ │ │ │ └── AdbMysqlClientConverterTest.java │ │ │ └── property │ │ │ │ ├── AdbMysqlBlockSizeTest.java │ │ │ │ ├── AdbMysqlHotPartitionCountTest.java │ │ │ │ └── AdbMysqlPropertyKeyTest.java │ │ │ ├── format │ │ │ ├── AdbMysqlOutVisitorTest.java │ │ │ └── AdbMysqlTimeFunctionTypeTest.java │ │ │ └── parser │ │ │ ├── AdbMysqlLanguageParserTest.java │ │ │ └── tree │ │ │ └── AdbMysqlDataTypeNameTest.java │ │ └── resources │ │ └── adbmysql │ │ ├── adbmysql_date_format.txt │ │ ├── adbmysql_date_format_result.txt │ │ ├── external │ │ ├── hudi.txt │ │ ├── maxcompute.txt │ │ ├── mongodb.txt │ │ ├── ots.txt │ │ ├── rds.txt │ │ └── textfile.txt │ │ ├── index │ │ ├── ann.txt │ │ ├── cluster.txt │ │ ├── foreign.txt │ │ ├── fulltext.txt │ │ ├── json.txt │ │ └── json2.txt │ │ ├── issue.txt │ │ ├── issue2.txt │ │ ├── issue_full_type.txt │ │ ├── simple.txt │ │ ├── simple_db.txt │ │ └── simple_result.txt ├── fastmodel-transform-adbpg │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── adbpg │ │ │ │ └── parser │ │ │ │ ├── AdbPostgreSQLLexer.g4 │ │ │ │ └── AdbPostgreSQLParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── adbpg │ │ │ ├── AdbPostgreSQLTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── client │ │ │ └── converter │ │ │ │ ├── AdbPostgreSQLClientConverter.java │ │ │ │ └── AdbPostgreSQLPropertyConverter.java │ │ │ ├── context │ │ │ └── AdbPostgreSQLTransformContext.java │ │ │ ├── format │ │ │ └── AdbPostgreSQLOutVisitor.java │ │ │ └── parser │ │ │ ├── AdbPostgreSQLAstBuilder.java │ │ │ ├── AdbPostgreSQLLanguageParser.java │ │ │ ├── AdbPostgreSQLLexerBase.java │ │ │ ├── AdbPostgreSQLParseError.java │ │ │ ├── AdbPostgreSQLParserBase.java │ │ │ ├── AdbPostgreSQLParserErrorListener.java │ │ │ ├── tree │ │ │ ├── AdbPostgreSQLPartitionBy.java │ │ │ └── partition │ │ │ │ └── desc │ │ │ │ ├── AdbPostgreSQLRangeElement.java │ │ │ │ ├── PartitionIntervalExpression.java │ │ │ │ └── PartitionValueExpression.java │ │ │ └── visitor │ │ │ └── AdbPostgreSQLVisitor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── adbpg │ │ │ ├── AdbPostgreSQLTransformerTest.java │ │ │ └── parser │ │ │ └── AdbPostgreSQLLanguageParserTest.java │ │ └── resources │ │ └── adbpostgresql │ │ ├── basic.txt │ │ ├── default.txt │ │ ├── films.txt │ │ ├── partition_by.txt │ │ ├── property.txt │ │ ├── sub_partition_by.txt │ │ └── sub_partition_with_template.txt ├── fastmodel-transform-api │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── api │ │ │ ├── Transformer.java │ │ │ ├── TransformerFactory.java │ │ │ ├── builder │ │ │ ├── BaseCompositeStatementBuilder.java │ │ │ ├── BuilderAnnotation.java │ │ │ ├── BuilderFactory.java │ │ │ ├── StatementBuilder.java │ │ │ └── merge │ │ │ │ ├── MergeBuilder.java │ │ │ │ ├── MergeResult.java │ │ │ │ ├── exception │ │ │ │ ├── MergeErrorCode.java │ │ │ │ └── MergeException.java │ │ │ │ └── impl │ │ │ │ └── CreateTableMergeBuilder.java │ │ │ ├── client │ │ │ ├── ClientConverter.java │ │ │ ├── CodeGenerator.java │ │ │ ├── PropertyConverter.java │ │ │ ├── converter │ │ │ │ ├── BaseClientConverter.java │ │ │ │ └── BasePropertyConverter.java │ │ │ ├── dto │ │ │ │ ├── constraint │ │ │ │ │ ├── Constraint.java │ │ │ │ │ ├── ConstraintType.java │ │ │ │ │ └── OutlineConstraintType.java │ │ │ │ ├── index │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── IndexKey.java │ │ │ │ │ └── IndexSortType.java │ │ │ │ ├── property │ │ │ │ │ ├── BaseClientProperty.java │ │ │ │ │ └── StringProperty.java │ │ │ │ ├── request │ │ │ │ │ ├── BaseGeneratorRequest.java │ │ │ │ │ ├── DdlGeneratorModelRequest.java │ │ │ │ │ ├── DdlGeneratorSqlRequest.java │ │ │ │ │ └── DdlReverseSqlRequest.java │ │ │ │ ├── result │ │ │ │ │ ├── DdlGeneratorResult.java │ │ │ │ │ └── DdlTableResult.java │ │ │ │ └── table │ │ │ │ │ ├── Column.java │ │ │ │ │ ├── Table.java │ │ │ │ │ └── TableConfig.java │ │ │ └── generator │ │ │ │ └── DefaultCodeGenerator.java │ │ │ ├── compare │ │ │ ├── CompareContext.java │ │ │ ├── CompareResult.java │ │ │ ├── NodeCompare.java │ │ │ └── NodeCompareFactory.java │ │ │ ├── context │ │ │ ├── ReverseContext.java │ │ │ ├── TransformContext.java │ │ │ └── setting │ │ │ │ ├── QuerySetting.java │ │ │ │ └── ViewSetting.java │ │ │ ├── datatype │ │ │ ├── BaseDataTypeConverter.java │ │ │ ├── DataTypeConverter.java │ │ │ ├── DataTypeConverterFactory.java │ │ │ └── simple │ │ │ │ ├── ISimpleDataTypeName.java │ │ │ │ ├── SimpleDataTypeName.java │ │ │ │ ├── SimpleDataTypeNameConverter.java │ │ │ │ └── SimpleDataTypeNameFactory.java │ │ │ ├── dialect │ │ │ ├── Dialect.java │ │ │ ├── DialectMeta.java │ │ │ ├── DialectName.java │ │ │ ├── DialectNode.java │ │ │ ├── GenericDialectNode.java │ │ │ ├── IDialectName.java │ │ │ ├── IVersion.java │ │ │ └── transform │ │ │ │ ├── DialectTransform.java │ │ │ │ └── DialectTransformParam.java │ │ │ ├── domain │ │ │ ├── DomainObject.java │ │ │ ├── ValueObject.java │ │ │ ├── dqc │ │ │ │ ├── BaseRuleModel.java │ │ │ │ ├── EntityRules.java │ │ │ │ ├── RuleTemplate.java │ │ │ │ ├── SelfCustomRuleModel.java │ │ │ │ ├── TemplateRuleModel.java │ │ │ │ └── constant │ │ │ │ │ ├── BlockType.java │ │ │ │ │ ├── CheckerType.java │ │ │ │ │ ├── EntityLevel.java │ │ │ │ │ ├── PredictType.java │ │ │ │ │ ├── PropertyType.java │ │ │ │ │ ├── RuleType.java │ │ │ │ │ └── TemplateDefine.java │ │ │ ├── factory │ │ │ │ ├── DomainFactory.java │ │ │ │ ├── DomainFactorySingleton.java │ │ │ │ └── impl │ │ │ │ │ └── TableDomainFactory.java │ │ │ ├── indicator │ │ │ │ └── IndicatorDataModel.java │ │ │ └── table │ │ │ │ ├── ColDataModel.java │ │ │ │ ├── ConstraintDataModel.java │ │ │ │ ├── TableColModel.java │ │ │ │ └── TableDataModel.java │ │ │ ├── exception │ │ │ └── ReverseUnsupportedOperationException.java │ │ │ ├── extension │ │ │ ├── client │ │ │ │ ├── constraint │ │ │ │ │ ├── DistributeClientConstraint.java │ │ │ │ │ ├── ExtensionClientConstraintType.java │ │ │ │ │ ├── ForeignKeyClientConstraint.java │ │ │ │ │ └── UniqueKeyExprClientConstraint.java │ │ │ │ ├── converter │ │ │ │ │ └── ExtensionClientConverter.java │ │ │ │ └── property │ │ │ │ │ ├── ExtensionPropertyKey.java │ │ │ │ │ ├── column │ │ │ │ │ └── AggrColumnProperty.java │ │ │ │ │ ├── index │ │ │ │ │ ├── IndexCommentProperty.java │ │ │ │ │ └── IndexTypeProperty.java │ │ │ │ │ └── table │ │ │ │ │ ├── ClusterKey.java │ │ │ │ │ ├── ColumnOrder.java │ │ │ │ │ ├── DistributeBucketsNum.java │ │ │ │ │ ├── DistributeHash.java │ │ │ │ │ ├── PartitionLiveNumberProperty.java │ │ │ │ │ ├── ReplicationNum.java │ │ │ │ │ ├── TablePartitionRaw.java │ │ │ │ │ └── partition │ │ │ │ │ ├── v1 │ │ │ │ │ ├── ArrayClientPartitionKey.java │ │ │ │ │ ├── BaseClientPartitionKey.java │ │ │ │ │ ├── LessThanClientPartitionKey.java │ │ │ │ │ ├── ListClientPartition.java │ │ │ │ │ ├── ListPartitionProperty.java │ │ │ │ │ ├── MultiRangeClientPartition.java │ │ │ │ │ ├── MultiRangePartitionProperty.java │ │ │ │ │ ├── PartitionClientValue.java │ │ │ │ │ ├── SingleRangeClientPartition.java │ │ │ │ │ ├── SingleRangePartitionProperty.java │ │ │ │ │ ├── TimeExpressionClientPartition.java │ │ │ │ │ └── TimeExpressionPartitionProperty.java │ │ │ │ │ └── v2 │ │ │ │ │ ├── PartitionElementClient.java │ │ │ │ │ ├── SubPartitionClient.java │ │ │ │ │ ├── SubPartitionElementClient.java │ │ │ │ │ ├── SubTemplatePartitionClient.java │ │ │ │ │ ├── list │ │ │ │ │ ├── ListPartitionClient.java │ │ │ │ │ ├── ListPartitionElementClient.java │ │ │ │ │ ├── ListPartitionProperty.java │ │ │ │ │ ├── SubListPartitionClient.java │ │ │ │ │ ├── SubListPartitionElementClient.java │ │ │ │ │ └── SubListTemplatePartitionClient.java │ │ │ │ │ └── range │ │ │ │ │ ├── RangePartitionClient.java │ │ │ │ │ ├── RangePartitionElementClient.java │ │ │ │ │ ├── RangePartitionProperty.java │ │ │ │ │ ├── SubRangePartitionClient.java │ │ │ │ │ ├── SubRangePartitionElementClient.java │ │ │ │ │ └── SubRangeTemplatePartitionClient.java │ │ │ ├── tree │ │ │ │ ├── column │ │ │ │ │ └── AggregateDesc.java │ │ │ │ ├── constraint │ │ │ │ │ ├── AggregateKeyConstraint.java │ │ │ │ │ ├── Algorithm.java │ │ │ │ │ ├── CheckExpressionConstraint.java │ │ │ │ │ ├── ClusteredKeyConstraint.java │ │ │ │ │ ├── DistanceMeasure.java │ │ │ │ │ ├── DuplicateKeyConstraint.java │ │ │ │ │ ├── ForeignKeyConstraint.java │ │ │ │ │ ├── UniqueKeyExprConstraint.java │ │ │ │ │ ├── WaterMarkConstraint.java │ │ │ │ │ └── desc │ │ │ │ │ │ ├── ClusterNonKeyConstraint.java │ │ │ │ │ │ ├── DistributeNonKeyConstraint.java │ │ │ │ │ │ ├── NonKeyConstraint.java │ │ │ │ │ │ ├── OrderByNonKeyConstraint.java │ │ │ │ │ │ ├── RollupItem.java │ │ │ │ │ │ └── RollupNonKeyConstraint.java │ │ │ │ └── partition │ │ │ │ │ ├── ExpressionPartitionBy.java │ │ │ │ │ ├── ListPartitionedBy.java │ │ │ │ │ ├── PartitionByType.java │ │ │ │ │ ├── RangePartitionedBy.java │ │ │ │ │ ├── desc │ │ │ │ │ ├── MultiItemListPartition.java │ │ │ │ │ ├── MultiRangePartition.java │ │ │ │ │ ├── PartitionDesc.java │ │ │ │ │ ├── SingleItemListPartition.java │ │ │ │ │ └── SingleRangePartition.java │ │ │ │ │ ├── keyvalue │ │ │ │ │ ├── ArrayPartitionKey.java │ │ │ │ │ ├── LessThanPartitionKey.java │ │ │ │ │ ├── ListPartitionValue.java │ │ │ │ │ ├── PartitionKey.java │ │ │ │ │ └── PartitionValue.java │ │ │ │ │ └── sub │ │ │ │ │ ├── BaseSubPartition.java │ │ │ │ │ ├── SubHashPartition.java │ │ │ │ │ ├── SubKeyPartition.java │ │ │ │ │ ├── SubListPartition.java │ │ │ │ │ ├── SubRangePartition.java │ │ │ │ │ ├── element │ │ │ │ │ ├── BasePartitionElement.java │ │ │ │ │ ├── BaseSubPartitionElement.java │ │ │ │ │ ├── HashPartitionElement.java │ │ │ │ │ ├── ListPartitionElement.java │ │ │ │ │ ├── RangePartitionElement.java │ │ │ │ │ ├── SubHashPartitionElement.java │ │ │ │ │ ├── SubListPartitionElement.java │ │ │ │ │ ├── SubPartitionList.java │ │ │ │ │ └── SubRangePartitionElement.java │ │ │ │ │ └── template │ │ │ │ │ ├── SubHashTemplatePartition.java │ │ │ │ │ ├── SubKeyTemplatePartition.java │ │ │ │ │ ├── SubListTemplatePartition.java │ │ │ │ │ └── SubRangeTemplatePartition.java │ │ │ └── visitor │ │ │ │ └── ExtensionAstVisitor.java │ │ │ ├── format │ │ │ ├── BaseSampleDataProvider.java │ │ │ ├── BaseViewVisitor.java │ │ │ ├── DefaultExpressionVisitor.java │ │ │ ├── PropertyKey.java │ │ │ └── PropertyValueType.java │ │ │ ├── sqlconvert │ │ │ ├── SqlConvertFactory.java │ │ │ └── SqlConverter.java │ │ │ └── util │ │ │ ├── PropertyKeyUtil.java │ │ │ └── StringJoinUtil.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── api │ │ │ ├── TransformerFactoryTest.java │ │ │ ├── builder │ │ │ ├── merge │ │ │ │ ├── MergeBuilderTest.java │ │ │ │ └── impl │ │ │ │ │ └── CreateTableMergeBuilderTest.java │ │ │ └── model │ │ │ │ └── TemplateDefineTest.java │ │ │ ├── client │ │ │ └── CodeGeneratorTest.java │ │ │ ├── compare │ │ │ ├── NodeCompareFactoryTest.java │ │ │ └── NodeCompareTest.java │ │ │ ├── datatype │ │ │ └── simple │ │ │ │ └── SimpleDataTypeNameFactoryTest.java │ │ │ ├── dialect │ │ │ ├── DialectMetaTest.java │ │ │ ├── DialectNameTest.java │ │ │ └── transform │ │ │ │ └── DialectTransformTest.java │ │ │ ├── domain │ │ │ └── factory │ │ │ │ └── impl │ │ │ │ └── TableDomainFactoryTest.java │ │ │ ├── format │ │ │ └── StringJoinUtilTest.java │ │ │ └── util │ │ │ └── PropertyKeyUtilTest.java │ │ └── resources │ │ └── transform.puml ├── fastmodel-transform-clickhouse │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── clickhouse │ │ │ │ └── parser │ │ │ │ ├── ClickHouseLexer.g4 │ │ │ │ └── ClickHouseParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── clickhouse │ │ │ ├── ClickHouseTransformer.java │ │ │ └── parser │ │ │ ├── ClickHouseLanguageParser.java │ │ │ ├── tree │ │ │ ├── ClickHouseDataTypeName.java │ │ │ ├── ClickHouseEnumDataTypeParameter.java │ │ │ ├── ClickHouseGenericDataType.java │ │ │ └── ClickHouseTableType.java │ │ │ └── visitor │ │ │ └── ClickHouseAstBuilder.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── clickhouse │ │ ├── ClickHouseTransformerTest.java │ │ └── parser │ │ └── ClickHouseLanguageParserTest.java ├── fastmodel-transform-doris │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── doris │ │ │ │ └── parser │ │ │ │ ├── DorisLexer.g4 │ │ │ │ └── DorisParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── doris │ │ │ ├── DorisTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── client │ │ │ ├── DorisClientConverter.java │ │ │ └── DorisPropertyConverter.java │ │ │ ├── context │ │ │ └── DorisContext.java │ │ │ ├── format │ │ │ ├── DorisExpressionVisitor.java │ │ │ ├── DorisOutVisitor.java │ │ │ └── DorisPropertyKey.java │ │ │ └── parser │ │ │ ├── DorisLanguageParser.java │ │ │ ├── tree │ │ │ ├── DorisDataTypeName.java │ │ │ └── DorisGenericDataType.java │ │ │ ├── util │ │ │ └── DorisReservedWordUtil.java │ │ │ └── visitor │ │ │ ├── DorisAstBuilder.java │ │ │ └── DorisAstVisitor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── doris │ │ │ ├── DorisTransformerTest.java │ │ │ ├── client │ │ │ ├── DorisClientConverterTest.java │ │ │ ├── DorisGenerator2Test.java │ │ │ ├── DorisGeneratorAlterTest.java │ │ │ └── DorisGeneratorTest.java │ │ │ ├── format │ │ │ └── DorisOutVisitorTest.java │ │ │ └── parser │ │ │ ├── DorisLanguageParserTest.java │ │ │ └── util │ │ │ └── DorisReservedWordUtilTest.java │ │ └── resources │ │ └── doris │ │ ├── issue.txt │ │ ├── property.txt │ │ ├── range.txt │ │ ├── range_error.txt │ │ └── steppartition.txt ├── fastmodel-transform-example │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── example │ │ │ │ ├── TransformStarter.java │ │ │ │ ├── integrate │ │ │ │ ├── AbstractTransformIntegrate.java │ │ │ │ ├── MaxComputeToHologresIntegrate.java │ │ │ │ └── MysqlTransformIntegrate.java │ │ │ │ └── ui │ │ │ │ └── SqlTransformFrame.java │ │ └── resources │ │ │ └── example │ │ │ ├── mysql.ddl.txt │ │ │ └── source.fml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── example │ │ │ ├── BaseTransformCaseTest.java │ │ │ ├── TransformAddColCaseTest.java │ │ │ ├── TransformAddConstraintCaseTest.java │ │ │ ├── TransformCompareColumnTest.java │ │ │ ├── TransformHologresTest.java │ │ │ ├── TransformStarterHiveTest.java │ │ │ ├── TransformStarterTest.java │ │ │ ├── TransformTableTest.java │ │ │ ├── compare │ │ │ ├── CodeTableCompareTest.java │ │ │ └── CompareDdlTest.java │ │ │ ├── dialect │ │ │ └── DialectTransformTest.java │ │ │ ├── integrate │ │ │ ├── MaxComputeToHologresIntegrateTest.java │ │ │ └── MysqlTransformIntegrateTest.java │ │ │ ├── simple │ │ │ └── SimpleDataTypeNameFactoryTest.java │ │ │ └── util │ │ │ └── JsonFileIO.java │ │ └── resources │ │ ├── expect_value_AddColNot.json │ │ ├── expect_value_AddColPrimary.json │ │ ├── expect_value_AddNotNull.json │ │ ├── expect_value_AddPrimaryKey.json │ │ ├── expect_value_AddPrimaryKeyConstraintMore.json │ │ ├── expect_value_AddPrimaryKeyConstraintOne.json │ │ ├── expect_value_ChangeColName.json │ │ ├── expect_value_ChangeColNotNull.json │ │ ├── expect_value_ChangeColNull.json │ │ ├── expect_value_ChangeColPrimary.json │ │ ├── expect_value_DropCol.json │ │ ├── expect_value_codeTable.json │ │ ├── expect_value_createDqcRule.json │ │ ├── expect_value_createTable.json │ │ └── expect_value_deleteNotNull.json ├── fastmodel-transform-excel │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── excel │ │ │ └── spi │ │ │ ├── InputStreamSource.java │ │ │ ├── Plugin.java │ │ │ ├── PluginConfig.java │ │ │ ├── PluginContext.java │ │ │ ├── PluginDataSource.java │ │ │ ├── PluginManager.java │ │ │ ├── SheetConfig.java │ │ │ ├── SheetName.java │ │ │ └── source │ │ │ ├── ClassPathResource.java │ │ │ ├── DefaultInputStreamSource.java │ │ │ └── FileResource.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── excel │ │ └── spi │ │ ├── SheetNameTest.java │ │ └── source │ │ ├── ClassPathResourceTest.java │ │ └── DefaultInputStreamSourceTest.java ├── fastmodel-transform-flink │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com.aliyun.fastmodel.transform.flink.parser │ │ │ │ ├── FlinkSqlLexer.g4 │ │ │ │ └── FlinkSqlParser.g4 │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── flink │ │ │ │ ├── FlinkTransformer.java │ │ │ │ ├── builder │ │ │ │ └── DefaultBuilder.java │ │ │ │ ├── client │ │ │ │ ├── converter │ │ │ │ │ ├── FlinkClientConverter.java │ │ │ │ │ └── FlinkPropertyConverter.java │ │ │ │ └── property │ │ │ │ │ └── FlinkPropertyKey.java │ │ │ │ ├── context │ │ │ │ └── FlinkTransformContext.java │ │ │ │ ├── format │ │ │ │ ├── FlinkColumnPropertyKey.java │ │ │ │ └── FlinkOutVisitor.java │ │ │ │ └── parser │ │ │ │ ├── FlinkLanguageParser.java │ │ │ │ ├── tree │ │ │ │ └── datatype │ │ │ │ │ ├── FlinkDataTypeName.java │ │ │ │ │ ├── FlinkGenericDataType.java │ │ │ │ │ ├── FlinkRawDataType.java │ │ │ │ │ └── FlinkRowDataType.java │ │ │ │ ├── util │ │ │ │ └── FlinkReservedWordUtil.java │ │ │ │ └── visitor │ │ │ │ ├── FlinkAstBuilder.java │ │ │ │ ├── FlinkAstVisitor.java │ │ │ │ ├── FlinkExpressionAstVisitor.java │ │ │ │ └── FlinkParserAstBuilder.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── maven │ │ │ │ └── archetype.xml │ │ │ └── archetype-resources │ │ │ ├── pom.xml │ │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── App.java │ │ │ └── test │ │ │ └── java │ │ │ └── AppTest.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── flink │ │ └── FlinkTransformerTest.java ├── fastmodel-transform-fml │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── fml │ │ │ ├── FmlTransformer.java │ │ │ ├── compare │ │ │ └── FmlNodeCompare.java │ │ │ ├── context │ │ │ └── FmlTransformContext.java │ │ │ ├── datatype │ │ │ └── Fml2OracleDataTypeConverter.java │ │ │ └── format │ │ │ ├── FmlExpressionVisitor.java │ │ │ ├── FmlFormatter.java │ │ │ └── FmlVisitor.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── fml │ │ ├── FmlTransformerTest.java │ │ ├── compare │ │ └── FmlNodeCompareTest.java │ │ └── format │ │ ├── FmlExpressionVisitorTest.java │ │ └── FmlFormatterTest.java ├── fastmodel-transform-graph │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── graph │ │ │ ├── GraphTransformer.java │ │ │ ├── builder │ │ │ ├── CompositeStatementBuilder.java │ │ │ ├── CreateTableBuilder.java │ │ │ ├── GraphDialectNode.java │ │ │ └── RefRelationBuilder.java │ │ │ ├── context │ │ │ └── GraphTransformContext.java │ │ │ ├── domain │ │ │ ├── Edge.java │ │ │ ├── Element.java │ │ │ ├── FmlGraph.java │ │ │ ├── Vertex.java │ │ │ ├── VertexType.java │ │ │ └── table │ │ │ │ ├── TableEdge.java │ │ │ │ ├── TableVertex.java │ │ │ │ └── TableVertexType.java │ │ │ ├── exception │ │ │ └── ExportException.java │ │ │ └── exporter │ │ │ ├── ExportName.java │ │ │ ├── Exporter.java │ │ │ ├── ExporterFactory.java │ │ │ ├── exception │ │ │ └── ExporterNotExistException.java │ │ │ └── impl │ │ │ └── JacksonExporter.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── graph │ │ │ ├── BaseTransformerTest.java │ │ │ ├── GraphTransformerTest.java │ │ │ ├── builder │ │ │ ├── CompositeStatementBuilderTest.java │ │ │ └── RefObjectBuilderTest.java │ │ │ └── exporter │ │ │ └── impl │ │ │ └── JacksonExporterTest.java │ │ └── resources │ │ └── test │ │ └── graph.json ├── fastmodel-transform-hive │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ ├── com │ │ │ │ └── aliyun │ │ │ │ │ └── fastmodel │ │ │ │ │ └── transform │ │ │ │ │ └── hive │ │ │ │ │ └── parser │ │ │ │ │ ├── HintParser.g4 │ │ │ │ │ ├── HiveLexer.g4 │ │ │ │ │ └── HiveParser.g4 │ │ │ └── imports │ │ │ │ ├── FromClauseParser.g4 │ │ │ │ ├── IdentifiersParser.g4 │ │ │ │ └── SelectClauseParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── hive │ │ │ ├── HiveTransformer.java │ │ │ ├── builder │ │ │ ├── CompositeStatementBuilder.java │ │ │ ├── DefaultBuilder.java │ │ │ └── ViewBuilder.java │ │ │ ├── client │ │ │ ├── converter │ │ │ │ ├── HiveClientConverter.java │ │ │ │ └── HivePropertyConverter.java │ │ │ └── property │ │ │ │ ├── FieldsTerminated.java │ │ │ │ ├── LinesTerminated.java │ │ │ │ └── StorageFormat.java │ │ │ ├── compare │ │ │ └── HiveNodeCompare.java │ │ │ ├── context │ │ │ ├── HiveTransformContext.java │ │ │ └── RowFormat.java │ │ │ ├── datatype │ │ │ └── HiveSimpleDataTypeNameConverter.java │ │ │ ├── format │ │ │ ├── HiveExpressionVisitor.java │ │ │ ├── HiveFormatter.java │ │ │ ├── HiveHelper.java │ │ │ ├── HiveOutVisitor.java │ │ │ ├── HivePropertyKey.java │ │ │ ├── HiveSampleDataProvider.java │ │ │ └── HiveViewVisitor.java │ │ │ └── parser │ │ │ ├── HiveAstBuilder.java │ │ │ ├── HiveLanguageParser.java │ │ │ ├── tree │ │ │ └── datatype │ │ │ │ ├── HiveDataTypeName.java │ │ │ │ └── HiveGenericDataType.java │ │ │ ├── util │ │ │ └── HiveReservedWordUtil.java │ │ │ └── visitor │ │ │ └── HiveVisitor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── hive │ │ │ ├── HiveTransformerTest.java │ │ │ ├── builder │ │ │ ├── DefaultBuilderTest.java │ │ │ └── ViewBuilderTest.java │ │ │ ├── client │ │ │ ├── HiveCodeGeneratorExternalTest.java │ │ │ ├── HiveCodeGeneratorModelTest.java │ │ │ ├── converter │ │ │ │ ├── HiveClientConverterTest.java │ │ │ │ └── HivePropertyConverterTest.java │ │ │ └── property │ │ │ │ └── HivePropertyKeyTest.java │ │ │ ├── compare │ │ │ └── HiveNodeCompareTest.java │ │ │ ├── datatype │ │ │ └── HiveSimpleDataTypeNameConverterTest.java │ │ │ ├── format │ │ │ ├── HiveFormatterTest.java │ │ │ ├── HiveHelperTest.java │ │ │ ├── HiveOutVisitorTest.java │ │ │ └── HiveViewVisitorTest.java │ │ │ ├── lsp │ │ │ └── ConvertParserUtilTest.java │ │ │ └── parser │ │ │ ├── HiveAstBuilderTest.java │ │ │ ├── HiveLanguageParserTest.java │ │ │ ├── tree │ │ │ └── datatype │ │ │ │ ├── HiveDataTypeNameTest.java │ │ │ │ └── HiveGenericDataTypeTest.java │ │ │ └── util │ │ │ └── HiveReservedWordUtilTest.java │ │ └── resources │ │ └── lsp │ │ ├── HiveLexer.g4 │ │ └── HiveParser.g4 ├── fastmodel-transform-hologres │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── hologres │ │ │ │ └── parser │ │ │ │ ├── HologreSQLLexer.g4 │ │ │ │ └── HologreSQLParser.g4 │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── hologres │ │ │ │ ├── HologresTransformer.java │ │ │ │ ├── HologresV2Transformer.java │ │ │ │ ├── HologresV3Transformer.java │ │ │ │ ├── builder │ │ │ │ ├── DefaultBuilder.java │ │ │ │ ├── QueryBuilder.java │ │ │ │ └── v2 │ │ │ │ │ ├── DefaultV2Builder.java │ │ │ │ │ └── QueryV2Builder.java │ │ │ │ ├── client │ │ │ │ ├── converter │ │ │ │ │ ├── HologresClientConverter.java │ │ │ │ │ └── HologresPropertyConverter.java │ │ │ │ └── property │ │ │ │ │ ├── BinLogTTL.java │ │ │ │ │ ├── BitMapColumn.java │ │ │ │ │ ├── ClusterKey.java │ │ │ │ │ ├── ColumnOrder.java │ │ │ │ │ ├── ColumnStatus.java │ │ │ │ │ ├── DictEncodingColumn.java │ │ │ │ │ ├── DistributionKey.java │ │ │ │ │ ├── EnableBinLogLevel.java │ │ │ │ │ ├── EventTimeColumn.java │ │ │ │ │ ├── HologresPropertyKey.java │ │ │ │ │ ├── SegmentKey.java │ │ │ │ │ ├── Status.java │ │ │ │ │ ├── TableGroup.java │ │ │ │ │ ├── TableOrientation.java │ │ │ │ │ └── TimeToLiveSeconds.java │ │ │ │ ├── compare │ │ │ │ └── HologresNodeCompare.java │ │ │ │ ├── context │ │ │ │ └── HologresTransformContext.java │ │ │ │ ├── datatype │ │ │ │ └── HologresSimpleDataTypeNameConverter.java │ │ │ │ ├── dialect │ │ │ │ └── HologresVersion.java │ │ │ │ ├── format │ │ │ │ ├── HologresAstVisitor.java │ │ │ │ ├── HologresExpressionVisitor.java │ │ │ │ └── HologresFormatter.java │ │ │ │ └── parser │ │ │ │ ├── HologreSQLLexerBase.java │ │ │ │ ├── HologreSQLParseError.java │ │ │ │ ├── HologreSQLParserBase.java │ │ │ │ ├── HologreSQLParserErrorListener.java │ │ │ │ ├── HologresAstBuilder.java │ │ │ │ ├── HologresParser.java │ │ │ │ ├── tree │ │ │ │ ├── BeginWork.java │ │ │ │ ├── CommitWork.java │ │ │ │ ├── datatype │ │ │ │ │ ├── ArrayBounds.java │ │ │ │ │ ├── HologresArrayDataType.java │ │ │ │ │ ├── HologresArrayDataTypeName.java │ │ │ │ │ ├── HologresDataTypeName.java │ │ │ │ │ ├── HologresGenericDataType.java │ │ │ │ │ └── HologresRowDataType.java │ │ │ │ └── expr │ │ │ │ │ └── WithDataTypeNameExpression.java │ │ │ │ ├── util │ │ │ │ ├── BuilderUtil.java │ │ │ │ ├── HologresPropertyUtil.java │ │ │ │ └── HologresReservedWordUtil.java │ │ │ │ └── visitor │ │ │ │ ├── HologresRewriteVisitor.java │ │ │ │ └── HologresVisitor.java │ │ └── resources │ │ │ └── hologres │ │ │ └── builtin_function_name.txt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── hologres │ │ │ ├── HologresTransformerTest.java │ │ │ ├── HologresV2TransformerTest.java │ │ │ ├── HologresV3TransformerTest.java │ │ │ ├── builder │ │ │ ├── QueryBuilderTest.java │ │ │ └── v2 │ │ │ │ ├── DefaultV2BuilderTest.java │ │ │ │ └── QueryV2BuilderTest.java │ │ │ ├── client │ │ │ ├── converter │ │ │ │ ├── HologresClientConverterTest.java │ │ │ │ └── HologresPropertyConverterTest.java │ │ │ ├── generator │ │ │ │ ├── HologresCodeGeneratorAlterTest.java │ │ │ │ ├── HologresCodeGeneratorModelInvalidDataTypeTest.java │ │ │ │ ├── HologresCodeGeneratorModelKeyWordTest.java │ │ │ │ ├── HologresCodeGeneratorModelTest.java │ │ │ │ ├── HologresCodeGeneratorSetColumnCommentTest.java │ │ │ │ ├── HologresCodeGeneratorSetDefaultValueTest.java │ │ │ │ ├── HologresCodeGeneratorSetPropertyTest.java │ │ │ │ ├── HologresCodeGeneratorSqlTest.java │ │ │ │ ├── impl │ │ │ │ │ ├── BaseGeneratorTest.java │ │ │ │ │ ├── BinLogTTLTest.java │ │ │ │ │ ├── BitmapsColumnTest.java │ │ │ │ │ ├── ClusterKeyTest.java │ │ │ │ │ ├── EnableBinLogLevelTest.java │ │ │ │ │ └── SegementKeyTest.java │ │ │ │ └── issue │ │ │ │ │ ├── BaseIssueTest.java │ │ │ │ │ ├── Issue1Test.java │ │ │ │ │ ├── Issue2Test.java │ │ │ │ │ ├── Issue3Text.java │ │ │ │ │ ├── Issue4Text.java │ │ │ │ │ ├── Issue5Text.java │ │ │ │ │ └── Issue6Test.java │ │ │ └── property │ │ │ │ ├── DictEncodingColumnTest.java │ │ │ │ ├── DistributionKeyTest.java │ │ │ │ ├── HologresPropertyKeyTest.java │ │ │ │ ├── SegmentKeyTest.java │ │ │ │ ├── TableOrientationTest.java │ │ │ │ └── TimeToLiveSecondsTest.java │ │ │ ├── context │ │ │ ├── HologresTransformContextTest.java │ │ │ └── HologresTransformQueryContext.java │ │ │ ├── datatype │ │ │ └── HologresSimpleDataTypeNameConverterTest.java │ │ │ ├── dialect │ │ │ └── HologresVersionTest.java │ │ │ ├── format │ │ │ ├── HologresFormatterTest.java │ │ │ └── HologresRewriteVisitorTest.java │ │ │ └── parser │ │ │ ├── HologresParserTest.java │ │ │ ├── tree │ │ │ └── datatype │ │ │ │ ├── HologresArrayDataTypeNameTest.java │ │ │ │ ├── HologresDataTypeNameTest.java │ │ │ │ └── HologresGenericDataTypeTest.java │ │ │ ├── util │ │ │ ├── HologresPropertyUtilTest.java │ │ │ └── HologresReservedWordUtilTest.java │ │ │ └── visitor │ │ │ ├── HologresAstVisitorTest.java │ │ │ └── HologresExpressionVisitorTest.java │ │ └── resources │ │ └── hologres │ │ ├── auto.txt │ │ ├── default_text.txt │ │ ├── dynamic │ │ ├── alter │ │ │ ├── dynamic_no_column_after.txt │ │ │ └── dynamic_no_column_before.txt │ │ ├── dynamic_no_column.txt │ │ ├── dynamic_no_column.txt.result │ │ ├── dynamic_no_column2.txt │ │ ├── dynamic_no_column2.txt.result │ │ ├── dynamic_table.txt │ │ └── dynamic_table.txt.result │ │ ├── keyword.txt │ │ ├── merge.txt │ │ ├── npe.txt │ │ ├── numeric.txt │ │ ├── primary.txt │ │ ├── rename.txt │ │ ├── rename2.txt │ │ └── reverse_default_value.txt ├── fastmodel-transform-mysql │ ├── gen │ │ └── MySqlLexer.java │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── mysql │ │ │ │ └── parser │ │ │ │ ├── MySqlLexer.g4 │ │ │ │ └── MySqlParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── mysql │ │ │ ├── MysqlTransformer.java │ │ │ ├── builder │ │ │ ├── DefaultBuilder.java │ │ │ └── impl │ │ │ │ └── CompositeStatementBuilder.java │ │ │ ├── compare │ │ │ └── MysqlNodeCompare.java │ │ │ ├── context │ │ │ └── MysqlTransformContext.java │ │ │ ├── datatype │ │ │ └── Mysql2OracleDataTypeConverter.java │ │ │ ├── format │ │ │ └── MysqlVisitor.java │ │ │ └── parser │ │ │ ├── MysqlAstBuilder.java │ │ │ └── MysqlTransformerParser.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── mysql │ │ │ ├── MysqlTransformerTest.java │ │ │ ├── builder │ │ │ └── impl │ │ │ │ └── CompositeStatementBuilderTest.java │ │ │ ├── compare │ │ │ └── MysqlNodeCompareTest.java │ │ │ ├── datatype │ │ │ └── Mysql2OracleDataTypeConverterTest.java │ │ │ ├── format │ │ │ └── MysqlVisitorTest.java │ │ │ └── parser │ │ │ └── MysqlTransformerParserTest.java │ │ └── resources │ │ └── sql │ │ ├── adjunct.txt │ │ └── adjunct_after.txt ├── fastmodel-transform-oceanbase │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── oceanbase │ │ │ │ ├── mysql │ │ │ │ └── parser │ │ │ │ │ ├── OBLexer.g4 │ │ │ │ │ └── OBParser.g4 │ │ │ │ └── oracle │ │ │ │ └── parser │ │ │ │ ├── OBLexer.g4 │ │ │ │ └── OBParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── oceanbase │ │ │ ├── OceanBaseMysqlTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── client │ │ │ ├── OceanBaseMysqlPropertyConverter.java │ │ │ ├── converter │ │ │ │ ├── OceanBaseMysqlClientConverter.java │ │ │ │ ├── OceanBaseMysqlPropertyConverter.java │ │ │ │ └── partition │ │ │ │ │ ├── OceanBasePartitionClientConverter.java │ │ │ │ │ └── impl │ │ │ │ │ └── OceanBasePartitionClientConverterImpl.java │ │ │ ├── dto │ │ │ │ ├── HashPartitionProperty.java │ │ │ │ └── hash │ │ │ │ │ ├── HashPartitionClient.java │ │ │ │ │ ├── HashPartitionElementClient.java │ │ │ │ │ ├── SubHashPartitionClient.java │ │ │ │ │ └── SubHashPartitionElementClient.java │ │ │ └── property │ │ │ │ ├── SubPartitionClient.java │ │ │ │ ├── SubPartitionElementClient.java │ │ │ │ ├── hash │ │ │ │ ├── HashPartitionClient.java │ │ │ │ ├── HashPartitionElementClient.java │ │ │ │ ├── HashPartitionProperty.java │ │ │ │ ├── SubHashPartitionClient.java │ │ │ │ ├── SubHashPartitionElementClient.java │ │ │ │ └── SubHashTemplatePartitionClient.java │ │ │ │ ├── key │ │ │ │ ├── KeyPartitionClient.java │ │ │ │ ├── KeyPartitionProperty.java │ │ │ │ ├── SubKeyPartitionClient.java │ │ │ │ └── SubKeyTemplatePartitionClient.java │ │ │ │ ├── list │ │ │ │ ├── ListPartitionClient.java │ │ │ │ ├── ListPartitionElementClient.java │ │ │ │ ├── ListPartitionProperty.java │ │ │ │ ├── ListSubPartitionElementClient.java │ │ │ │ ├── SubListPartitionClient.java │ │ │ │ ├── SubListPartitionElementClient.java │ │ │ │ └── SubListTemplatePartitionClient.java │ │ │ │ └── range │ │ │ │ ├── RangePartitionClient.java │ │ │ │ ├── RangePartitionElementClient.java │ │ │ │ ├── RangePartitionProperty.java │ │ │ │ ├── SubRangePartitionClient.java │ │ │ │ ├── SubRangePartitionElementClient.java │ │ │ │ └── SubRangeTemplatePartitionClient.java │ │ │ ├── context │ │ │ └── OceanBaseContext.java │ │ │ ├── format │ │ │ ├── OceanBaseMysqlExpressionVisitor.java │ │ │ ├── OceanBaseMysqlOutVisitor.java │ │ │ └── OceanBasePropertyKey.java │ │ │ └── parser │ │ │ ├── OceanBaseMysqlAstBuilder.java │ │ │ ├── OceanBaseMysqlLanguageParser.java │ │ │ ├── tree │ │ │ ├── OceanBaseMysqlCharDataType.java │ │ │ ├── OceanBaseMysqlDataTypeName.java │ │ │ ├── OceanBaseMysqlGenericDataType.java │ │ │ └── partition │ │ │ │ ├── OceanBaseHashPartitionBy.java │ │ │ │ ├── OceanBaseKeyPartitionBy.java │ │ │ │ ├── OceanBaseListPartitionBy.java │ │ │ │ ├── OceanBasePartitionBy.java │ │ │ │ ├── OceanBaseRangePartitionBy.java │ │ │ │ └── desc │ │ │ │ ├── BaseSubPartition.java │ │ │ │ ├── SubHashPartition.java │ │ │ │ ├── SubKeyPartition.java │ │ │ │ ├── SubListPartition.java │ │ │ │ ├── SubRangePartition.java │ │ │ │ ├── element │ │ │ │ ├── HashPartitionElement.java │ │ │ │ ├── ListPartitionElement.java │ │ │ │ ├── PartitionElement.java │ │ │ │ ├── RangePartitionElement.java │ │ │ │ ├── SubHashPartitionElement.java │ │ │ │ ├── SubListPartitionElement.java │ │ │ │ ├── SubPartitionElement.java │ │ │ │ ├── SubPartitionList.java │ │ │ │ └── SubRangePartitionElement.java │ │ │ │ └── template │ │ │ │ ├── SubHashTemplatePartition.java │ │ │ │ ├── SubKeyTemplatePartition.java │ │ │ │ ├── SubListTemplatePartition.java │ │ │ │ └── SubRangeTemplatePartition.java │ │ │ └── visitor │ │ │ └── OceanBaseMysqlAstVisitor.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── oceanbase │ │ │ ├── BaseOceanbaseTest.java │ │ │ ├── OceanBaseMysqlTransformerTest.java │ │ │ ├── client │ │ │ ├── OceanBaseGeneratorAlterTest.java │ │ │ ├── OceanBaseGeneratorTest.java │ │ │ ├── OceanBaseGeneratorWithModelTest.java │ │ │ └── converter │ │ │ │ ├── OceanBaseMysqlClientConverterTest.java │ │ │ │ └── partition │ │ │ │ └── impl │ │ │ │ └── OceanBasePartitionClientConverterImplTest.java │ │ │ └── parser │ │ │ ├── OceanBaseMysqlLanguageParserTest.java │ │ │ └── tree │ │ │ └── OceanBaseMysqlDataTypeNameTest.java │ │ └── resources │ │ └── oceanbase │ │ ├── range_error.txt │ │ ├── simple1.txt │ │ ├── simple10_timestamp.txt │ │ ├── simple1_comment.txt │ │ ├── simple2_index.txt │ │ ├── simple2_index2.txt │ │ ├── simple3_hash.txt │ │ ├── simple3_range.txt │ │ ├── simple4_charset.txt │ │ ├── simple5_compress.txt │ │ ├── simple6_pr.txt │ │ ├── simple7_autoincrement.txt │ │ ├── simple8_check.txt │ │ ├── simple8_reference.txt │ │ ├── simple9_pt_combine_1.txt │ │ ├── simple9_pt_combine_2.txt │ │ ├── simple9_pt_combine_3.txt │ │ ├── simple9_pt_hash.txt │ │ ├── simple9_pt_key.txt │ │ ├── simple9_pt_list.txt │ │ └── simple9_pt_range.txt ├── fastmodel-transform-oracle │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── oracle │ │ │ │ └── parser │ │ │ │ ├── PlSqlLexer.g4 │ │ │ │ └── PlSqlParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── oracle │ │ │ ├── Oracle11Transformer.java │ │ │ ├── builder │ │ │ └── DefaultOracleBuilder.java │ │ │ ├── context │ │ │ └── OracleContext.java │ │ │ ├── datatype │ │ │ ├── Oracle2FmlDataTypeConverter.java │ │ │ └── Oracle2MysqlDataTypeConverter.java │ │ │ ├── format │ │ │ └── OracleVisitor.java │ │ │ └── parser │ │ │ ├── OracleAstBuilder.java │ │ │ ├── OracleParser.java │ │ │ ├── PlSqlLexerBase.java │ │ │ └── PlSqlParserBase.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── oracle │ │ ├── Oracle11TransformerTest.java │ │ ├── datatype │ │ ├── Oracle2FmlDataTypeConverterTest.java │ │ └── Oracle2MysqlDataTypeConverterTest.java │ │ ├── format │ │ └── OracleVisitorTest.java │ │ └── parser │ │ └── OracleParserTest.java ├── fastmodel-transform-plantuml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── plantuml │ │ │ │ ├── PlantUmlTransformer.java │ │ │ │ ├── diagram │ │ │ │ └── DiagramGenerator.java │ │ │ │ ├── exception │ │ │ │ ├── VisualParseException.java │ │ │ │ └── VisualTemplateNotFoundException.java │ │ │ │ └── parser │ │ │ │ ├── Fragment.java │ │ │ │ ├── FragmentFactory.java │ │ │ │ ├── FragmentImpl.java │ │ │ │ ├── FragmentParser.java │ │ │ │ └── impl │ │ │ │ ├── IndicatorFragmentParser.java │ │ │ │ ├── RefRelationFragmentParser.java │ │ │ │ └── TableFragmentParser.java │ │ └── resources │ │ │ ├── Library.iuml │ │ │ └── fragment │ │ │ ├── indicator.ftl │ │ │ ├── refRelation.ftl │ │ │ └── table.ftl │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── plantuml │ │ │ ├── IndicatorFragmentParserTest.java │ │ │ ├── PlantUmlTransformerTest.java │ │ │ ├── TableFragmentParserTest.java │ │ │ └── parser │ │ │ └── impl │ │ │ └── RefRelationFragmentParserTest.java │ │ └── resources │ │ ├── importtest.txt │ │ ├── plantuml.sql │ │ └── plantuml │ │ ├── entity.puml │ │ └── relation.puml ├── fastmodel-transform-postgresql │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── postgresql │ │ │ │ └── parser │ │ │ │ ├── PostgreSQLLexer.g4 │ │ │ │ └── PostgreSQLParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── postgresql │ │ │ ├── client │ │ │ ├── converter │ │ │ │ └── PostgreSQLClientConverter.java │ │ │ └── property │ │ │ │ └── PostgreSQLPropertyKey.java │ │ │ ├── context │ │ │ └── PostgreSQLTransformContext.java │ │ │ ├── format │ │ │ └── PostgreSQLOutVisitor.java │ │ │ └── parser │ │ │ ├── PostgreSQLAstBuilder.java │ │ │ ├── PostgreSQLLanguageParser.java │ │ │ ├── PostgreSQLLexerBase.java │ │ │ ├── PostgreSQLParseError.java │ │ │ ├── PostgreSQLParserBase.java │ │ │ ├── PostgreSQLParserErrorListener.java │ │ │ ├── tree │ │ │ ├── BeginWork.java │ │ │ ├── CommitWork.java │ │ │ ├── datatype │ │ │ │ ├── ArrayBounds.java │ │ │ │ ├── PostgreSQLArrayDataType.java │ │ │ │ ├── PostgreSQLArrayDataTypeName.java │ │ │ │ ├── PostgreSQLDataTypeName.java │ │ │ │ ├── PostgreSQLGenericDataType.java │ │ │ │ ├── PostgreSQLIntervalDataType.java │ │ │ │ └── PostgreSQLRowDataType.java │ │ │ └── expr │ │ │ │ └── WithDataTypeNameExpression.java │ │ │ ├── util │ │ │ └── PostgreSQLReservedWordUtil.java │ │ │ └── visitor │ │ │ ├── PostgreSQLExpressionVisitor.java │ │ │ └── PostgreSQLVisitor.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── postgresql │ │ └── parser │ │ └── PostgreSQLLanguageParserTest.java ├── fastmodel-transform-spark │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── spark │ │ │ │ └── parser │ │ │ │ ├── SparkLexer.g4 │ │ │ │ └── SparkParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── spark │ │ │ ├── SparkTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── context │ │ │ ├── SparkTableFormat.java │ │ │ └── SparkTransformContext.java │ │ │ ├── format │ │ │ ├── SparkAstBuilder.java │ │ │ ├── SparkPropertyKey.java │ │ │ └── SparkVisitor.java │ │ │ └── parser │ │ │ └── SparkLanguageParser.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── spark │ │ ├── builder │ │ └── DefaultBuilderTest.java │ │ ├── context │ │ └── SparkTransformContextTest.java │ │ ├── format │ │ ├── SparkPropertyKeyTest.java │ │ └── SparkVisitorTest.java │ │ └── parser │ │ ├── SparkLanguageParserTest.java │ │ └── SparkTransformerTest.java ├── fastmodel-transform-sqlite │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── sqlite │ │ │ │ └── parser │ │ │ │ ├── SQLiteLexer.g4 │ │ │ │ └── SQLiteParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── sqlite │ │ │ ├── SqliteTransformer.java │ │ │ ├── builder │ │ │ └── DefaultBuilder.java │ │ │ ├── context │ │ │ └── SqliteContext.java │ │ │ ├── datatype │ │ │ └── Fml2SqliteDataTypeConverter.java │ │ │ ├── format │ │ │ ├── SqliteExpressionVisitor.java │ │ │ └── SqliteVisitor.java │ │ │ └── parser │ │ │ ├── SqliteLanguageParser.java │ │ │ ├── datatype │ │ │ └── SqliteDataTypeName.java │ │ │ └── visitor │ │ │ └── SqliteAstBuilder.java │ │ └── test │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── sqlite │ │ ├── SqliteTransformerTest.java │ │ └── parser │ │ └── SqliteLanguageParserTest.java ├── fastmodel-transform-starrocks │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ ├── com │ │ │ │ └── aliyun │ │ │ │ │ └── fastmodel │ │ │ │ │ └── transform │ │ │ │ │ └── starrocks │ │ │ │ │ └── parser │ │ │ │ │ └── StarRocks.g4 │ │ │ └── imports │ │ │ │ └── StarRocksLex.g4 │ │ ├── java │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── starrocks │ │ │ │ ├── StarRocksTransformer.java │ │ │ │ ├── builder │ │ │ │ └── DefaultBuilder.java │ │ │ │ ├── client │ │ │ │ └── converter │ │ │ │ │ ├── StarRocksClientConverter.java │ │ │ │ │ └── StarRocksPropertyConverter.java │ │ │ │ ├── context │ │ │ │ └── StarRocksContext.java │ │ │ │ ├── format │ │ │ │ ├── StarRocksExpressionVisitor.java │ │ │ │ ├── StarRocksOutVisitor.java │ │ │ │ ├── StarRocksProperty.java │ │ │ │ ├── StarRocksPropertyKey.java │ │ │ │ └── TimeFunctionType.java │ │ │ │ └── parser │ │ │ │ ├── StarRocksLanguageParser.java │ │ │ │ ├── tree │ │ │ │ └── datatype │ │ │ │ │ ├── StarRocksDataTypeName.java │ │ │ │ │ └── StarRocksGenericDataType.java │ │ │ │ ├── util │ │ │ │ └── StarRocksReservedWordUtil.java │ │ │ │ └── visitor │ │ │ │ ├── StarRocksAstBuilder.java │ │ │ │ └── StarRocksAstVisitor.java │ │ └── resources │ │ │ └── starrocks │ │ │ └── list.txt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── fastmodel │ │ │ └── transform │ │ │ └── starrocks │ │ │ ├── StarRocksTransformerTest.java │ │ │ ├── client │ │ │ ├── constraint │ │ │ │ └── ExtensionClientConstraintTypeTest.java │ │ │ ├── converter │ │ │ │ ├── StarRocksClientConverterTest.java │ │ │ │ └── StarRocksPropertyKeyConverterTest.java │ │ │ └── generator │ │ │ │ ├── StarRocksGeneratorAlterTest.java │ │ │ │ └── StarRocksGeneratorTest.java │ │ │ ├── format │ │ │ └── StarRocksOutVisitorTest.java │ │ │ └── parser │ │ │ ├── StarRocksLanguageParserTest.java │ │ │ ├── tree │ │ │ └── datatype │ │ │ │ └── StarRocksDataTypeNameTest.java │ │ │ └── util │ │ │ └── StarRocksReservedWordUtilTest.java │ │ └── resources │ │ └── starrocks │ │ └── issue.txt ├── fastmodel-transform-template │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── aliyun │ │ └── fastmodel │ │ └── transform │ │ └── template │ │ ├── BaseFmlTemplateFactory.java │ │ ├── FmlTemplate.java │ │ ├── FmlTemplateFactory.java │ │ ├── exception │ │ └── FmlTemplateException.java │ │ └── freemarker │ │ ├── FreeMarkerTemplate.java │ │ └── FreeMarkerTemplateFactoryImpl.java ├── fastmodel-transform-zen │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── antlr4 │ │ │ └── com │ │ │ │ └── aliyun │ │ │ │ └── fastmodel │ │ │ │ └── transform │ │ │ │ └── zen │ │ │ │ └── parser │ │ │ │ ├── FastModelZenLexer.g4 │ │ │ │ └── FastModelZenParser.g4 │ │ └── java │ │ │ └── com │ │ │ └── aliyun │ │ │ └── aliyun │ │ │ └── transform │ │ │ └── zen │ │ │ ├── ZenTransformer.java │ │ │ ├── builder │ │ │ └── DefaultZenBuilder.java │ │ │ ├── compare │ │ │ └── ZenNodeCompare.java │ │ │ ├── converter │ │ │ ├── ColumnConverterVisitor.java │ │ │ ├── ZenNodeColumnDefinitionConverter.java │ │ │ ├── ZenNodeConvertContext.java │ │ │ ├── ZenNodeConverter.java │ │ │ └── ZenNodeConverterFactory.java │ │ │ ├── element │ │ │ ├── ColElement.java │ │ │ └── NodeElement.java │ │ │ ├── format │ │ │ └── ZenVisitor.java │ │ │ └── parser │ │ │ ├── BaseZenAstVisitor.java │ │ │ ├── ZenAstBuilder.java │ │ │ ├── ZenParser.java │ │ │ ├── ZenParserImpl.java │ │ │ └── tree │ │ │ ├── AtomicZenExpression.java │ │ │ ├── AttributeZenExpression.java │ │ │ ├── BaseAtomicZenExpression.java │ │ │ ├── BaseZenExpression.java │ │ │ ├── BaseZenNode.java │ │ │ └── BrotherZenExpression.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── aliyun │ │ │ └── aliyun │ │ │ └── transform │ │ │ └── zen │ │ │ ├── ZenNodeColumnDefinitionConverterTest.java │ │ │ ├── ZenParserImplTest.java │ │ │ ├── ZenTransformerTest.java │ │ │ ├── compare │ │ │ ├── ZenNodeCompareTest.java │ │ │ └── ZenNodeReverseTest.java │ │ │ ├── format │ │ │ └── ZenVisitorTest.java │ │ │ └── ui │ │ │ └── ZenConverterFrame.java │ │ └── resources │ │ └── issue │ │ └── issue.txt └── pom.xml ├── license.txt ├── lombok.config └── pom.xml /NOTICE: -------------------------------------------------------------------------------- 1 | ======================================================== 2 | fast-modeling-language is a modeling dsl 3 | Copyright (c) 2019-2022, Alibaba Group. 4 | Licensed under the Apache License, Version 2.0 5 | =================================================================== 6 | This product contains various third-party components under other open source licenses. 7 | This section summarizes those components and their licenses. 8 | 9 | 10 | Presto Software Apache License 2.0 11 | -------------------------------------- 12 | com.facebook.presto.sql.QueryUtil 13 | 14 | 15 | grammars-v4 Software Apache License, Version 2.0 16 | ------------------------------------------------- 17 | sql/hive/v3/HiveParser.g4 18 | sql/hive/v3/HiveLexer.g4 19 | sql/plsql/PlSqlParser.g4 20 | sql/plsql/PlSqlLexer.g4 21 | 22 | 23 | grammars-v4 Software The MIT License (MIT) 24 | ----------------------------------------------- 25 | sql/mysql/Positive-Technologies/MySqlParser.g4 26 | sql/mysql/Positive-Technologies/MySqlLexer.g4 -------------------------------------------------------------------------------- /cd.json: -------------------------------------------------------------------------------- 1 | { 2 | "cname": "fml.alibaba-inc.com", 3 | "public": "./docs" 4 | } -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/docs/.nojekyll -------------------------------------------------------------------------------- /docs/zh-cn/indicator/adjunct.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/docs/zh-cn/indicator/adjunct.md -------------------------------------------------------------------------------- /docs/zh-cn/indicator/derivative.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/docs/zh-cn/indicator/derivative.md -------------------------------------------------------------------------------- /docs/zh-cn/indicator/time_period.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/docs/zh-cn/indicator/time_period.md -------------------------------------------------------------------------------- /docs/zh-cn/jdbc/cli.md: -------------------------------------------------------------------------------- 1 | # Cli 2 | 3 | FML支持通过Cli(command line interface)访问建模引擎。 4 | 5 | 6 | ## 安装 7 | 8 | 下载fast-modeling-language源码,在根目录下执行 9 | ```shell 10 | mvn clean install -Dmaven.test.skip 11 | ``` 12 | 13 | ``` 14 | cd fastmodel-driver/fastmodel-driver-cli/target/zip 15 | ``` 16 | 17 | ## 配置 18 | 19 | ``` 20 | unzip fastmodel-driver-cli-${version}-distribution.zip 21 | ``` 22 | 23 | ```shell 24 | fastmodel.url=localhost:18080 25 | fastmodel.ssl=false 26 | fastmodel.database= 27 | fastmodel.password= 28 | fastmodel.user= 29 | ``` 30 | 31 | 32 | ## 启动 33 | 34 | ```shell 35 | ./start.sh 36 | ``` 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/zh-cn/layer/business_category.md: -------------------------------------------------------------------------------- 1 | ## 业务分类 2 | 3 | 如您所在的集团或公司业务复杂且较为庞大时,可创建业务分类,对数据进行业务区分,便于对业务数据进行更加方便的管理。本文为您介绍如何创建业务分类并关联数据域及管理数据集市。 4 | 5 | ## 数据集市 6 | 7 | 创建完成业务分类后,您可以在该业务分类页面的数据集市管理区域,查看当前业务分类挂载的数据集市列表,并根据业务需求对目标数据集市进行编辑或删除等管理操作。 8 | 9 | ## 主题域 10 | 11 | 主题域用于将数据集市按照分析视角进行划分,通常是联系较为紧密的数据主题的集合。您可以根据业务的关注点,将这些数据主题划分至不同的主题域。例如,电商行业通常分为交易域、会员域、商品域等。 12 | 13 | -------------------------------------------------------------------------------- /docs/zh-cn/layer/business_process.md: -------------------------------------------------------------------------------- 1 | # 业务过程 2 | 3 | 业务过程是企业在指定的数据域中所执行的业务活动,是数据建模所需要分析的逻辑主体。例如,交易域中可以有加入购物车、下单、支付等业务过程。本文为您介绍如何创建并使用业务过程。 4 | 具体描述:[链接](https://help.aliyun.com/document_detail/276956.html?spm=a2c4g.397548.4.1.35e72121xqDgoR&scm=20140722.H_276956._.ID_276956-OR_rec-V_1) 5 | 6 | 业务过程是企业在指定的数据域中所执行的业务活动,是数据建模所需要分析的逻辑主体。例如,交易域中可以有加入购物车、下单、支付等业务过程。本文为您介绍如何创建并使用业务过程。 7 | 具体描述:[链接](https://help.aliyun.com/document_detail/276956.html?spm=a2c4g.397548.4.1.35e72121xqDgoR&scm=20140722.H_276956._.ID_276956-OR_rec-V_1) -------------------------------------------------------------------------------- /docs/zh-cn/layer/data_domain.md: -------------------------------------------------------------------------------- 1 | # 数据域 -------------------------------------------------------------------------------- /docs/zh-cn/layer/guide.md: -------------------------------------------------------------------------------- 1 | 数仓规划是架构师在进行数仓建设分层划域的内容,涉及到数仓的顶层涉及内容,包括数据域的划分、业务过程的划分。数仓分层划分等等一些设计。 FML同时支持数仓规范的定义处理,包括以下操作: 2 | 3 | | 常见操作 | 说明 | 4 | |----------|-------------------| 5 | | 创建数仓分层 | 定义project下数仓的分层定义 | 6 | | 创建数据域 | 定义project下数据域信息 | 7 | | 创建业务过程 | 定义某个数据域下的业务过程的定义。 | 8 | | 创建业务分类 | 创建业务分类 | 9 | | 修改数仓分层名字 | 修改数仓分层名称 | 10 | | 修改数仓分层注释 | 修改数仓分层的注释 | 11 | | 修改数仓分层属性 | 修改数仓分层的属性 | 12 | | 修改数据域名称 | 修改数据域的名称 | 13 | | 修改数据域注释 | 修改数据域的注释 | 14 | | 修改数据域属性 | 修改数据域的属性 | 15 | | 修改业务分类名称 | 修改业务分类名称 | 16 | | 修改业务过程名字 | 修改业务过程名字 | 17 | | 修改业务过程注释 | 修改业务过程注释 | 18 | | 修改业务过程属性 | 修改业务过程属性 | 19 | | 删除数仓分层 | 删除数仓分层 | 20 | | 删除数据域 | 删除数据域 | 21 | | 删除业务过程 | 删除业务过程 | 22 | 23 | -------------------------------------------------------------------------------- /docs/zh-cn/model/dimension.md: -------------------------------------------------------------------------------- 1 | # 维度定义和属性 -------------------------------------------------------------------------------- /docs/zh-cn/model/quality.md: -------------------------------------------------------------------------------- 1 | # 数据质量 -------------------------------------------------------------------------------- /docs/zh-cn/query/guide.md: -------------------------------------------------------------------------------- 1 | # 查询语句总览 2 | 3 | ## 引言 4 | 5 | 你可以通过FML语句来进行模型信息的查询,目前FML提供了show语句来进行模型信息的查询,有点类型`mysql`中的show语句内容。 6 | 7 | 8 | 9 | ## 查询语法内容 10 | 11 | - 限制条件 12 | - 查询语句只支持查询当前业务板块的内容。 13 | - 命令格式 14 | 15 | ``` 16 | 17 | SHOW [FROM ] 18 | [condidtion]; 19 | 20 | object_type : 21 | LAYERS 22 | | DOMAINS 23 | | BUSINESS_PROCESSES 24 | | BUSINESS_CATEGORIES 25 | | MARKETS 26 | | SUBJECTS 27 | | [tableType] TABLES 28 | | [indicatorType] INDICATORS 29 | | ADJUNCTS 30 | | TIME_PERIODS 31 | | MEASURE_UNITS 32 | | DICTS 33 | | DICT GROUPS 34 | | MEASURE_UNIT GROUPS 35 | | COLUMNS 36 | | CODES 37 | | DIMENSIONS 38 | | DIM_ATTRIBUTES 39 | | DEPENDENCY 40 | ; 41 | 42 | condition : 43 | WHERE expression 44 | ; 45 | 46 | ``` 47 | 48 | - 参数说明 49 | - table_name, 可选,配合show columns进行使用。 50 | - condition, 可选,支持where的表达式的and和or的处理。 51 | -------------------------------------------------------------------------------- /docs/zh-cn/references/move_references.md: -------------------------------------------------------------------------------- 1 | ## Move References 2 | 3 | | 类型 | 功能 | 4 | |-----------------|---------| 5 | | move references | 移动对象的引用 | 6 | 7 | 一般配合`show REFERENCES`进行使用,将原来的对象移动到其他对象里,比如一个维度表原本是挂靠在数据域A上,希望可以挂靠在数据域B上。一种可以通过设置表的属性进行切换, 但是当数据域里的表比较多时,需要将 但是使用上比较低效,这时可以使用`move` 将数据域A移动到数据域B中, 命令: 8 | 9 | - 命令格式 10 | 11 | ``` 12 | MOVE REFERENCES FROM TO [WITH ] 13 | ``` 14 | 15 | - 限制条件 16 | - source和target如果一样,将不会任何内容处理 17 | - 命令参数 18 | - object_type : 对象类型,必选 19 | - 支持类型: 20 | - source : 必选,标识符, 可以使用:a.b.c这种形式 21 | - target : 必选,标识符,可以使用:a.b.c这种形式 22 | 23 | - 示例1, 将数据域tmall下引用的内容,都移动到数据域淘宝 24 | 25 | ```plain 26 | move data_domain references from tmall to tb 27 | ``` 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/zh-cn/references/show_references.md: -------------------------------------------------------------------------------- 1 | | 类型 | 功能 | 2 | |-----------------|------------------------| 3 | | show references | 来查看对象的依赖的内容 | 4 | 5 | - 使用场景 6 | 7 | - 查看业务过程的引用列表 8 | - 查看数据域的引用列表 9 | 10 | - 命令格式 11 | 12 | ``` 13 | KW_SHOW KW_REFERENCES KW_FROM (KW_WITH )? 14 | 15 | ``` 16 | 17 | - 参数说明 18 | - showType : 必选。详细可以查看 19 | - from : 必选,引用所属的对象名称 20 | - properties : 可选,key=value的形式,需要用单引号起来 21 | - 示例 22 | - 示例1,查看数据域为tmall的依赖内容 23 | 24 | ``` 25 | show domain references from tmall 26 | ``` 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/zh-cn/reverse/model.md: -------------------------------------------------------------------------------- 1 | # 逆向建模 2 | 3 | 你可以将大数据引擎中的表的信息,直接通过逆向语句,同步转换为模型信息。 -------------------------------------------------------------------------------- /docs/zh-cn/roadmap.md: -------------------------------------------------------------------------------- 1 | ## RoadMap 2 | 3 | ```plantuml 4 | projectscale quarterly 5 | @startgantt 6 | Project starts 2022-03-01 7 | [支持hologres的从sql逆向到fml模型处理] lasts 15 days 8 | [支持clickhouse sql的转换和逆向处理] lasts 30 days 9 | [支持FML元数据能力] lasts 60 days 10 | [引擎数据类型转换可定制] lasts 60 days 11 | [引擎数据类型转换可定制]->[支持clickhouse sql的转换和逆向处理] 12 | [支持hologres的从sql逆向到fml模型处理] -> [引擎数据类型转换可定制] 13 | @endgantt 14 | -------------------------------------------------------------------------------- /docs/zh-cn/standard/code_table.md: -------------------------------------------------------------------------------- 1 | # 标准代码 -------------------------------------------------------------------------------- /docs/zh-cn/standard/measure_unit.md: -------------------------------------------------------------------------------- 1 | # 度量单位 -------------------------------------------------------------------------------- /docs/zh-cn/standard/standard_dict.md: -------------------------------------------------------------------------------- 1 | # 字段标准 -------------------------------------------------------------------------------- /docs/zh-cn/transformer/hologres.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/docs/zh-cn/transformer/hologres.md -------------------------------------------------------------------------------- /docs/zh-cn/transformer/other.md: -------------------------------------------------------------------------------- 1 | ## Zen 2 | 一种快捷的编写列的方式语言,用户只需要提供列名,类型,描述就可以批量、快捷的添加列信息。 3 | 4 | ## PlantUML 5 | 一种UML类图的形式化语言,可以方便的使用PlantUML来编写UML图,FML支持将模型脚本,转换为PlantUML模型语言。 6 | 7 | ## Graph 8 | 基于JGraphT类库的,展示语言,可以将FML图形化的展示的信息,导出为JGraphT的图形化结构内容。用于前端渲染和展示。 -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/java/com/aliyun/fastmodel/benchmarks/PerformanceExec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.benchmarks; 18 | 19 | /** 20 | * performance exec 21 | * 22 | * @author panguanjing 23 | * @date 2021/4/1 24 | */ 25 | public interface PerformanceExec { 26 | /** 27 | * 具体的执行操作 28 | */ 29 | void execute(); 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/performance/single.txt: -------------------------------------------------------------------------------- 1 | -- 创建维度表-门店 2 | CREATE DIM TABLE IF NOT EXISTS test_bu.dim_shop 3 | ( 4 | shop_code string COMMENT '门店code', 5 | shop_name string COMMENT '门店name', 6 | shop_type string COMMENT '门店类型', 7 | merchant_code bigint COMMENT '商家code', 8 | primary key (shop_code) 9 | ) COMMENT '门店' WITH PROPERTIES('business_process'='test_bp'); -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/1.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Pricing Summary Report Query (Q1) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_returnflag, 9 | l_linestatus, 10 | sum(l_quantity) as sum_qty, 11 | sum(l_extendedprice) as sum_base_price, 12 | sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, 13 | sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, 14 | avg(l_quantity) as avg_qty, 15 | avg(l_extendedprice) as avg_price, 16 | avg(l_discount) as avg_disc, 17 | count(*) as count_order 18 | from 19 | lineitem 20 | where 21 | l_shipdate <= date '1998-12-01' - interval ':1' day 22 | group by 23 | l_returnflag, 24 | l_linestatus 25 | order by 26 | l_returnflag, 27 | l_linestatus 28 | LIMIT 1; 29 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/10.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Returned Item Reporting Query (Q10) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_custkey, 9 | c_name, 10 | sum(l_extendedprice * (1 - l_discount)) as revenue, 11 | c_acctbal, 12 | n_name, 13 | c_address, 14 | c_phone, 15 | c_comment 16 | from 17 | customer, 18 | orders, 19 | lineitem, 20 | nation 21 | where 22 | c_custkey = o_custkey 23 | and l_orderkey = o_orderkey 24 | and o_orderdate >= date ':1' 25 | and o_orderdate < date ':1' + interval '3' month 26 | and l_returnflag = 'R' 27 | and c_nationkey = n_nationkey 28 | group by 29 | c_custkey, 30 | c_name, 31 | c_acctbal, 32 | c_phone, 33 | n_name, 34 | c_address, 35 | c_comment 36 | order by 37 | revenue desc 38 | LIMIT 20; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/11.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Important Stock Identification Query (Q11) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | ps_partkey, 9 | sum(ps_supplycost * ps_availqty) as value 10 | from 11 | partsupp, 12 | supplier, 13 | nation 14 | where 15 | ps_suppkey = s_suppkey 16 | and s_nationkey = n_nationkey 17 | and n_name = ':1' 18 | group by 19 | ps_partkey having 20 | sum(ps_supplycost * ps_availqty) > ( 21 | select 22 | sum(ps_supplycost * ps_availqty) * :2 23 | from 24 | partsupp, 25 | supplier, 26 | nation 27 | where 28 | ps_suppkey = s_suppkey 29 | and s_nationkey = n_nationkey 30 | and n_name = ':1' 31 | ) 32 | order by 33 | value desc 34 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/12.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Shipping Modes and Order Priority Query (Q12) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_shipmode, 9 | sum(case 10 | when o_orderpriority = '1-URGENT' 11 | or o_orderpriority = '2-HIGH' 12 | then 1 13 | else 0 14 | end) as high_line_count, 15 | sum(case 16 | when o_orderpriority <> '1-URGENT' 17 | and o_orderpriority <> '2-HIGH' 18 | then 1 19 | else 0 20 | end) as low_line_count 21 | from 22 | orders, 23 | lineitem 24 | where 25 | o_orderkey = l_orderkey 26 | and l_shipmode in (':1', ':2') 27 | and l_commitdate < l_receiptdate 28 | and l_shipdate < l_commitdate 29 | and l_receiptdate >= date ':3' 30 | and l_receiptdate < date ':3' + interval '1' year 31 | group by 32 | l_shipmode 33 | order by 34 | l_shipmode 35 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/13.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Customer Distribution Query (Q13) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_count, 9 | count(*) as custdist 10 | from 11 | ( 12 | select 13 | c_custkey, 14 | count(o_orderkey) 15 | from 16 | customer left outer join orders on 17 | c_custkey = o_custkey 18 | and o_comment not like '%:1%:2%' 19 | group by 20 | c_custkey 21 | ) as c_orders (c_custkey, c_count) 22 | group by 23 | c_count 24 | order by 25 | custdist desc, 26 | c_count desc 27 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/14.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Promotion Effect Query (Q14) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | 100.00 * sum(case 9 | when p_type like 'PROMO%' 10 | then l_extendedprice * (1 - l_discount) 11 | else 0 12 | end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue 13 | from 14 | lineitem, 15 | part 16 | where 17 | l_partkey = p_partkey 18 | and l_shipdate >= date ':1' 19 | and l_shipdate < date ':1' + interval '1' month 20 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/15.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Top Supplier Query (Q15) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | create view revenue:s (supplier_no, total_revenue) as 7 | select 8 | l_suppkey, 9 | sum(l_extendedprice * (1 - l_discount)) 10 | from 11 | lineitem 12 | where 13 | l_shipdate >= date ':1' 14 | and l_shipdate < date ':1' + interval '3' month 15 | group by 16 | l_suppkey; 17 | 18 | :o 19 | select 20 | s_suppkey, 21 | s_name, 22 | s_address, 23 | s_phone, 24 | total_revenue 25 | from 26 | supplier, 27 | revenue:s 28 | where 29 | s_suppkey = supplier_no 30 | and total_revenue = ( 31 | select 32 | max(total_revenue) 33 | from 34 | revenue:s 35 | ) 36 | order by 37 | s_suppkey 38 | LIMIT 1; 39 | 40 | drop view revenue:s; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/16.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Parts/Supplier Relationship Query (Q16) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | p_brand, 9 | p_type, 10 | p_size, 11 | count(distinct ps_suppkey) as supplier_cnt 12 | from 13 | partsupp, 14 | part 15 | where 16 | p_partkey = ps_partkey 17 | and p_brand <> ':1' 18 | and p_type not like ':2%' 19 | and p_size in (':3', ':4', ':5', ':6', ':7', ':8', ':9', ':10') 20 | and ps_suppkey not in ( 21 | select 22 | s_suppkey 23 | from 24 | supplier 25 | where 26 | s_comment like '%Customer%Complaints%' 27 | ) 28 | group by 29 | p_brand, 30 | p_type, 31 | p_size 32 | order by 33 | supplier_cnt desc, 34 | p_brand, 35 | p_type, 36 | p_size 37 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/17.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | sum(l_extendedprice) / 7.0 as avg_yearly 9 | from 10 | lineitem, 11 | part, 12 | (SELECT l_partkey AS agg_partkey, 0.2 * avg(l_quantity) AS avg_quantity FROM lineitem GROUP BY l_partkey) part_agg 13 | where 14 | p_partkey = l_partkey 15 | and agg_partkey = l_partkey 16 | and p_brand = ':1' 17 | and p_container = ':2' 18 | and l_quantity < avg_quantity 19 | LIMIT 1; 20 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/18.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Large Volume Customer Query (Q18) 3 | -- Function Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_name, 9 | c_custkey, 10 | o_orderkey, 11 | o_orderdate, 12 | o_totalprice, 13 | sum(l_quantity) 14 | from 15 | customer, 16 | orders, 17 | lineitem 18 | where 19 | o_orderkey in ( 20 | select 21 | l_orderkey 22 | from 23 | lineitem 24 | group by 25 | l_orderkey having 26 | sum(l_quantity) > :1 27 | ) 28 | and c_custkey = o_custkey 29 | and o_orderkey = l_orderkey 30 | group by 31 | c_name, 32 | c_custkey, 33 | o_orderkey, 34 | o_orderdate, 35 | o_totalprice 36 | order by 37 | o_totalprice desc, 38 | o_orderdate 39 | LIMIT 100; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/2.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Minimum Cost Supplier Query (Q2) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | s_acctbal, 9 | s_name, 10 | n_name, 11 | p_partkey, 12 | p_mfgr, 13 | s_address, 14 | s_phone, 15 | s_comment 16 | from 17 | part, 18 | supplier, 19 | partsupp, 20 | nation, 21 | region 22 | where 23 | p_partkey = ps_partkey 24 | and s_suppkey = ps_suppkey 25 | and p_size = :1 26 | and p_type like '%:2' 27 | and s_nationkey = n_nationkey 28 | and n_regionkey = r_regionkey 29 | and r_name = ':3' 30 | and ps_supplycost = ( 31 | select 32 | min(ps_supplycost) 33 | from 34 | partsupp, 35 | supplier, 36 | nation, 37 | region 38 | where 39 | p_partkey = ps_partkey 40 | and s_suppkey = ps_suppkey 41 | and s_nationkey = n_nationkey 42 | and n_regionkey = r_regionkey 43 | and r_name = ':3' 44 | ) 45 | order by 46 | s_acctbal desc, 47 | n_name, 48 | s_name, 49 | p_partkey 50 | LIMIT 100; 51 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/21.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Suppliers Who Kept Orders Waiting Query (Q21) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | s_name, 9 | count(*) as numwait 10 | from 11 | supplier, 12 | lineitem l1, 13 | orders, 14 | nation 15 | where 16 | s_suppkey = l1.l_suppkey 17 | and o_orderkey = l1.l_orderkey 18 | and o_orderstatus = 'F' 19 | and l1.l_receiptdate > l1.l_commitdate 20 | and exists ( 21 | select 22 | * 23 | from 24 | lineitem l2 25 | where 26 | l2.l_orderkey = l1.l_orderkey 27 | and l2.l_suppkey <> l1.l_suppkey 28 | ) 29 | and not exists ( 30 | select 31 | * 32 | from 33 | lineitem l3 34 | where 35 | l3.l_orderkey = l1.l_orderkey 36 | and l3.l_suppkey <> l1.l_suppkey 37 | and l3.l_receiptdate > l3.l_commitdate 38 | ) 39 | and s_nationkey = n_nationkey 40 | and n_name = ':1' 41 | group by 42 | s_name 43 | order by 44 | numwait desc, 45 | s_name 46 | LIMIT 100; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/22.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Global Sales Opportunity Query (Q22) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | cntrycode, 9 | count(*) as numcust, 10 | sum(c_acctbal) as totacctbal 11 | from 12 | ( 13 | select 14 | substring(c_phone from 1 for 2) as cntrycode, 15 | c_acctbal 16 | from 17 | customer 18 | where 19 | substring(c_phone from 1 for 2) in 20 | (':1', ':2', ':3', ':4', ':5', ':6', ':7') 21 | and c_acctbal > ( 22 | select 23 | avg(c_acctbal) 24 | from 25 | customer 26 | where 27 | c_acctbal > 0.00 28 | and substring(c_phone from 1 for 2) in 29 | (':1', ':2', ':3', ':4', ':5', ':6', ':7') 30 | ) 31 | and not exists ( 32 | select 33 | * 34 | from 35 | orders 36 | where 37 | o_custkey = c_custkey 38 | ) 39 | ) as custsale 40 | group by 41 | cntrycode 42 | order by 43 | cntrycode 44 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/3.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Shipping Priority Query (Q3) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_orderkey, 9 | sum(l_extendedprice * (1 - l_discount)) as revenue, 10 | o_orderdate, 11 | o_shippriority 12 | from 13 | customer, 14 | orders, 15 | lineitem 16 | where 17 | c_mktsegment = ':1' 18 | and c_custkey = o_custkey 19 | and l_orderkey = o_orderkey 20 | and o_orderdate < date ':2' 21 | and l_shipdate > date ':2' 22 | group by 23 | l_orderkey, 24 | o_orderdate, 25 | o_shippriority 26 | order by 27 | revenue desc, 28 | o_orderdate 29 | LIMIT 10; -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/4.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Order Priority Checking Query (Q4) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | o_orderpriority, 9 | count(*) as order_count 10 | from 11 | orders 12 | where 13 | o_orderdate >= date ':1' 14 | and o_orderdate < date ':1' + interval '3' month 15 | and exists ( 16 | select 17 | * 18 | from 19 | lineitem 20 | where 21 | l_orderkey = o_orderkey 22 | and l_commitdate < l_receiptdate 23 | ) 24 | group by 25 | o_orderpriority 26 | order by 27 | o_orderpriority 28 | LIMIT 1; 29 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/5.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Local Supplier Volume Query (Q5) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | n_name, 9 | sum(l_extendedprice * (1 - l_discount)) as revenue 10 | from 11 | customer, 12 | orders, 13 | lineitem, 14 | supplier, 15 | nation, 16 | region 17 | where 18 | c_custkey = o_custkey 19 | and l_orderkey = o_orderkey 20 | and l_suppkey = s_suppkey 21 | and c_nationkey = s_nationkey 22 | and s_nationkey = n_nationkey 23 | and n_regionkey = r_regionkey 24 | and r_name = ':1' 25 | and o_orderdate >= date ':2' 26 | and o_orderdate < date ':2' + interval '1' year 27 | group by 28 | n_name 29 | order by 30 | revenue desc 31 | LIMIT 1; 32 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/6.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Forecasting Revenue Change Query (Q6) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | sum(l_extendedprice * l_discount) as revenue 9 | from 10 | lineitem 11 | where 12 | l_shipdate >= date ':1' 13 | and l_shipdate < date ':1' + interval '1' year 14 | and l_discount between :2 - 0.01 and :2 + 0.01 15 | and l_quantity < :3 16 | LIMIT 1; 17 | -------------------------------------------------------------------------------- /fastmodel-benchmarks/src/main/resources/tpch/9.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Product Type Profit Measure Query (Q9) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | nation, 9 | o_year, 10 | sum(amount) as sum_profit 11 | from 12 | ( 13 | select 14 | n_name as nation, 15 | extract(year from o_orderdate) as o_year, 16 | l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount 17 | from 18 | part, 19 | supplier, 20 | lineitem, 21 | partsupp, 22 | orders, 23 | nation 24 | where 25 | s_suppkey = l_suppkey 26 | and ps_suppkey = l_suppkey 27 | and ps_partkey = l_partkey 28 | and p_partkey = l_partkey 29 | and o_orderkey = l_orderkey 30 | and s_nationkey = n_nationkey 31 | and p_name like '%:1%' 32 | ) as profit 33 | group by 34 | nation, 35 | o_year 36 | order by 37 | nation, 38 | o_year desc 39 | LIMIT 1; -------------------------------------------------------------------------------- /fastmodel-compare/src/main/java/com/aliyun/fastmodel/compare/impl/table/TableElementCompare.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.compare.impl.table; 10 | 11 | import java.util.List; 12 | 13 | import com.aliyun.fastmodel.core.tree.BaseStatement; 14 | import com.aliyun.fastmodel.core.tree.statement.table.CreateTable; 15 | 16 | /** 17 | * 比对表元素信息 18 | * 19 | * @author panguanjing 20 | * @date 2021/8/30 21 | */ 22 | public interface TableElementCompare { 23 | /** 24 | * 比对 25 | * 26 | * @param before 27 | * @param after 28 | * @return 29 | */ 30 | List compareTableElement(CreateTable before, CreateTable after); 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-compare/src/main/java/com/aliyun/fastmodel/compare/merge/Pipeline.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.compare.merge; 10 | 11 | import com.aliyun.fastmodel.core.tree.BaseStatement; 12 | import com.aliyun.fastmodel.core.tree.statement.table.CreateTable; 13 | 14 | /** 15 | * Desc: 16 | * 17 | * @author panguanjing 18 | * @date 2022/10/9 19 | */ 20 | public interface Pipeline { 21 | R process(R input, T baseStatement); 22 | } 23 | -------------------------------------------------------------------------------- /fastmodel-compare/src/main/java/com/aliyun/fastmodel/compare/merge/PipelineComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.compare.merge; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | /** 17 | * PipelineComponent 18 | * 19 | * @author panguanjing 20 | * @date 2022/10/9 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target(ElementType.TYPE) 24 | public @interface PipelineComponent { 25 | 26 | Class value(); 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/formatter/ExpressionFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.core.formatter; 10 | 11 | import com.aliyun.fastmodel.core.tree.expr.BaseExpression; 12 | 13 | /** 14 | * 格式化处理 15 | * 16 | * @author panguanjing 17 | * @date 2020/10/30 18 | */ 19 | public class ExpressionFormatter { 20 | 21 | private ExpressionFormatter() {} 22 | 23 | public static String formatExpression(BaseExpression baseExpression) { 24 | return new ExpressionVisitor().process(baseExpression, null); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/IStatementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.core.tree; 10 | 11 | /** 12 | * istatement type 13 | * 14 | * @author panguanjing 15 | * @date 2022/6/9 16 | */ 17 | public interface IStatementType { 18 | 19 | /** 20 | * @return 21 | */ 22 | String getCode(); 23 | 24 | /** 25 | * 简写默认于code一致 26 | * 27 | * @return 28 | */ 29 | default String getShortCode() { 30 | return getCode(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/datatype/JsonDataType.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.core.tree.datatype; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 6 | import com.aliyun.fastmodel.core.tree.NodeLocation; 7 | 8 | /** 9 | * jsonDataType 10 | * 11 | * @author panguanjing 12 | * @date 2023/6/18 13 | */ 14 | public class JsonDataType extends RowDataType { 15 | 16 | public JsonDataType(NodeLocation location, String origin, 17 | List fields) { 18 | super(location, origin, fields); 19 | } 20 | 21 | @Override 22 | public R accept(IAstVisitor visitor, C context) { 23 | return visitor.visitJsonDataType(this, context); 24 | } 25 | 26 | @Override 27 | public IDataTypeName getTypeName() { 28 | return DataTypeEnums.JSON; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/expr/enums/VarType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.core.tree.expr.enums; 18 | 19 | /** 20 | * VarType 21 | * 22 | * @author panguanjing 23 | * @date 2020/11/19 24 | */ 25 | public enum VarType { 26 | /** 27 | * $ 28 | */ 29 | DOLLAR, 30 | /** 31 | * # 32 | */ 33 | MACRO 34 | } 35 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/statement/table/index/IndexSortKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.core.tree.statement.table.index; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractFmlNode; 4 | 5 | /** 6 | * index sort key 7 | * 8 | * @author panguanjing 9 | * @date 2024/2/8 10 | */ 11 | public abstract class IndexSortKey extends AbstractFmlNode { 12 | } 13 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/statement/table/type/ITableDetailType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.core.tree.statement.table.type; 10 | 11 | /** 12 | * ITableDetailType 13 | * 14 | * @author panguanjing 15 | * @date 2022/7/10 16 | */ 17 | public interface ITableDetailType extends ITableType { 18 | 19 | /** 20 | * get parent Table Type 21 | * 22 | * @return {@link ITableType} 23 | */ 24 | ITableType getParent(); 25 | 26 | /** 27 | * is single detail Type 28 | * 29 | * @return 30 | */ 31 | default boolean isSingle() { 32 | return getCode().equalsIgnoreCase(getParent().getCode()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /fastmodel-core/src/main/java/com/aliyun/fastmodel/core/tree/statement/table/type/ITableType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.core.tree.statement.table.type; 10 | 11 | /** 12 | * tableType 13 | * 14 | * @author panguanjing 15 | * @date 2022/6/12 16 | */ 17 | public interface ITableType { 18 | /** 19 | * table Type value 20 | * 21 | * @return 22 | */ 23 | String getCode(); 24 | 25 | /** 26 | * description 27 | * 28 | * @return 表描述 29 | */ 30 | String getDescription(); 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-cli/src/main/resources/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | 1. 进行控制台,`./start.sh` 执行,默认会链接日常model-engine的服务断。 4 | 2. `fml.prperties`文件是配置信息,可以按照实际的情况配置信息。 5 | 6 | ## 文件配置信息 7 | 8 | * fastmodel.url= model-engine的地址 9 | * fastmodel.ssl=false #true使用https 10 | * fastmodel.database=1_14255 #使用的业务板块 11 | * fastmodel.token= #租户的token 12 | * fastmodel.baseKey= #租户的base key 13 | * fastmodel.path= #默认就是studio/driver 14 | * fastmodel.tenantId= #默认弹内1 -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-cli/src/main/resources/fml_config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | fastmodel.url=localhost:18080 17 | fastmodel.ssl=false 18 | fastmodel.database=database 19 | fastmodel.password=password 20 | fastmodel.user=user 21 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-cli/src/main/resources/start.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | java -jar fastmodel-driver-cli-${project.version}-executable.jar 17 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-cli/src/test/resources/test.http: -------------------------------------------------------------------------------- 1 | GET https://pre-kimball.alibaba-inc.com/stuido/driver 2 | Accept: application/json 3 | 4 | ### 5 | GET http://model-engine-v1.daily-ms.dw.alibaba-inc.com/studio/driver?database=dataworks 6 | Accept: application/json -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-client/src/test/java/com/aliyun/fastmodel/driver/client/command/sample/SampleCommandFactory.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.driver.client.command.sample; 2 | 3 | import java.util.Properties; 4 | 5 | import com.aliyun.fastmodel.driver.client.command.CommandFactory; 6 | import com.aliyun.fastmodel.driver.client.command.ExecuteCommand; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2022/4/30 13 | */ 14 | public class SampleCommandFactory implements CommandFactory { 15 | @Override 16 | public ExecuteCommand createStrategy(String commandType, Properties properties) { 17 | return new SampleExecuteCommand(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-client/src/test/java/com/aliyun/fastmodel/driver/client/command/sample/SampleCommandProperties.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.driver.client.command.sample; 2 | 3 | import java.util.Properties; 4 | 5 | import com.aliyun.fastmodel.driver.client.command.BaseCommandProperties; 6 | 7 | /** 8 | * Desc: 9 | * 10 | * @author panguanjing 11 | * @date 2022/4/30 12 | */ 13 | public class SampleCommandProperties extends BaseCommandProperties { 14 | public SampleCommandProperties(Properties properties) { 15 | super(properties); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-server/src/main/java/com/aliyun/fastmodel/driver/server/mock/MockCommandFactory.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.driver.server.mock; 2 | 3 | import java.util.Properties; 4 | 5 | import com.aliyun.fastmodel.driver.client.command.CommandFactory; 6 | import com.aliyun.fastmodel.driver.client.command.ExecuteCommand; 7 | import com.google.auto.service.AutoService; 8 | 9 | /** 10 | * for test 11 | * 12 | * @author panguanjing 13 | * @date 2022/4/30 14 | */ 15 | @AutoService(CommandFactory.class) 16 | public class MockCommandFactory implements CommandFactory { 17 | 18 | @Override 19 | public ExecuteCommand createStrategy(String commandType, Properties properties) { 20 | return new MockExecuteCommand(new MockCommandProperties(properties)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-server/src/main/java/com/aliyun/fastmodel/driver/server/mock/MockCommandProperties.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.driver.server.mock; 2 | 3 | import java.util.Properties; 4 | 5 | import com.aliyun.fastmodel.driver.client.command.BaseCommandProperties; 6 | 7 | /** 8 | * Desc: 9 | * 10 | * @author panguanjing 11 | * @date 2022/4/30 12 | */ 13 | public class MockCommandProperties extends BaseCommandProperties { 14 | public MockCommandProperties(Properties properties) { 15 | super(properties); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-server/src/main/resources/keytool_https.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | keytool -genkeypair -keyalg RSA -alias self_signed -keypass simulator -keystore lig.keystore -storepass simulator -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-server/src/main/resources/lig.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/fastmodel-driver/fastmodel-driver-server/src/main/resources/lig.keystore -------------------------------------------------------------------------------- /fastmodel-driver/fastmodel-driver-server/src/main/resources/nopic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/fastmodel-driver/fastmodel-driver-server/src/main/resources/nopic.jpg -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open-front/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | node 3 | node_modules 4 | log.txt 5 | /src/antlr/ 6 | /dist/ 7 | -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open-front/src/fastmodel/config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import * as monaco from "monaco-editor-core"; 18 | 19 | export const languageID = 'fml'; 20 | 21 | export const languageExtensionPoint: monaco.languages.ILanguageExtensionPoint = { 22 | id: languageID, 23 | } 24 | 25 | -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open-front/src/fastmodel/fastmodel.worker.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker'; 17 | import {FastmodelWorker} from "./fastmodelWorker"; 18 | 19 | self.onmessage = () => { 20 | worker.initialize((ctx) => { 21 | return new FastmodelWorker(ctx) 22 | }); 23 | }; -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open-front/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "allowJs": true, 6 | "jsx": "react" 7 | } 8 | } -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/java/com/aliyun/fastmodel/ide/open/start/model/context/DefaultInvokeContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.ide.open.start.model.context; 18 | 19 | /** 20 | * DefaultInvokeContext 21 | * 22 | * @author panguanjing 23 | * @date 2021/10/3 24 | */ 25 | public class DefaultInvokeContext { 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/java/com/aliyun/fastmodel/ide/open/start/model/dto/IParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.ide.open.start.model.dto; 18 | 19 | /** 20 | * 请求的DTO对象 21 | * 22 | * @author panguanjing 23 | * @date 2021/12/21 24 | */ 25 | public interface IParam { 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | spring.thymeleaf.cache=false 18 | server.port=7001 19 | spring.servlet.multipart.max-file-size=10000 20 | spring.servlet.multipart.max-request-size=10000 -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/resources/ascli.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | native2ascii -encoding UTF-8 i18n/messages.properties i18n/messages_zh_CN.properties 17 | -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/resources/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | COMMENT=可以使用COMMENT关键字进行定义 17 | NOT_FOUND=找不到关键字{0}的描述 18 | DIM=维度关键字,与`TABLE`一起使用定义维度表 19 | FACT=事实关键字,与`TABLE`一起使用定义事实表 20 | DWS=汇总包关键字,与`TABLE`定义汇总表 21 | ADS=应用表关键字,与`TABLE`定义应用表 22 | CREATE=DDL语句中的创建关键字 23 | TABLE=表的关键字 24 | PRIMARY=主键的关键字 25 | REF=定义模型之间关系关键字,格式如下:REF ->
: -------------------------------------------------------------------------------- /fastmodel-ide/fastmodel-ide-open/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/AdjunctParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar AdjunctParser; 2 | 3 | adjunctStatements: 4 | createAdjunct 5 | | renameAdjunct 6 | | setAdjunctComment 7 | | setAdjunctProperties 8 | | setAdjunctAlias 9 | | dropAdjunct 10 | ; 11 | 12 | /**创建修饰词**/ 13 | createAdjunct: 14 | KW_CREATE replace? KW_ADJUNCT ifNotExists? 15 | qualifiedName alias? 16 | (comment)? (KW_WITH setProperties)? 17 | (KW_AS expression)? 18 | ; 19 | 20 | setAdjunctAlias : 21 | KW_ALTER KW_ADJUNCT qualifiedName setAliasedName 22 | ; 23 | renameAdjunct: 24 | KW_ALTER KW_ADJUNCT qualifiedName alterStatementSuffixRename 25 | ; 26 | setAdjunctComment: 27 | KW_ALTER KW_ADJUNCT qualifiedName alterStatementSuffixSetComment 28 | ; 29 | 30 | setAdjunctProperties: 31 | KW_ALTER KW_ADJUNCT qualifiedName KW_SET setProperties? (KW_AS? expression)? 32 | ; 33 | 34 | dropAdjunct: 35 | KW_DROP KW_ADJUNCT qualifiedName 36 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/BusinessUnitParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar BusinessUnitParser; 2 | 3 | 4 | buStatements: 5 | createBuStatement 6 | | setBuComment 7 | | setBuAlias 8 | ; 9 | 10 | createBuStatement 11 | : KW_CREATE replace? KW_FULL_BU ifNotExists? 12 | qualifiedName 13 | alias? 14 | comment? 15 | (KW_WITH setProperties)? 16 | ; 17 | 18 | 19 | setBuAlias 20 | : KW_ALTER KW_FULL_BU identifier setAliasedName 21 | ; 22 | 23 | setBuComment 24 | : KW_ALTER KW_FULL_BU identifier alterStatementSuffixSetComment 25 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/CallParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar CallParser; 2 | 3 | call : 4 | KW_CALL functionExpression 5 | ; 6 | -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/CommandParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar CommandParser; 2 | 3 | commandStatements : 4 | commonSqlCommandStatement 5 | | helpCommandStatement 6 | ; 7 | 8 | commonSqlCommandStatement: 9 | commands dialectOptions commandOptions (KW_WITH setProperties)? 10 | ; 11 | 12 | helpCommandStatement : 13 | KW_HELP type=identifier (TEXT_OPTION string)? (KW_WITH setProperties)? 14 | ; 15 | 16 | 17 | 18 | dialectOptions: 19 | MODE_OPTION identifier 20 | ; 21 | commandOptions 22 | : TEXT_OPTION string 23 | | URI_OPTION string 24 | ; 25 | 26 | commands : 27 | type=KW_IMPORT_SQL 28 | | type=KW_EXPORT_SQL 29 | | type=KW_RENDER 30 | | type=KW_FORMAT 31 | ; 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/DictParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar DictParser; 2 | dictStatements: 3 | createDict 4 | | renameDict 5 | | setDictComment 6 | | setDictProperties 7 | | dropDataDict 8 | | setDictAlias 9 | ; 10 | createDict: 11 | KW_CREATE replace? KW_DICT ifNotExists? qualifiedName alias? 12 | typeDbCol columnConstraintType? defaultValue? comment? (KW_WITH setProperties)? 13 | ; 14 | 15 | setDictAlias: 16 | KW_ALTER KW_DICT qualifiedName setAliasedName 17 | ; 18 | renameDict: 19 | KW_ALTER KW_DICT qualifiedName alterStatementSuffixRename 20 | ; 21 | setDictComment: 22 | KW_ALTER KW_DICT qualifiedName alterStatementSuffixSetComment 23 | ; 24 | setDictProperties: 25 | KW_ALTER KW_DICT qualifiedName typeDbCol? 26 | columnConstraintType? enableSpecification? defaultValue? 27 | KW_SET setProperties? 28 | ; 29 | 30 | dropDataDict: 31 | KW_DROP KW_DICT qualifiedName 32 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/GroupParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar GroupParser; 2 | 3 | groupStatements: 4 | createGroup 5 | | setGroupComment 6 | | setGroupProperties 7 | | dropGroup 8 | | renameGroup 9 | | setGroupAlias 10 | ; 11 | createGroup: 12 | KW_CREATE replace? KW_GROUP type=groupType 13 | ifNotExists? qualifiedName 14 | alias? 15 | comment? (KW_WITH setProperties)? 16 | ; 17 | groupType : 18 | KW_MEASUREUNIT 19 | | KW_DICT 20 | | KW_CODE 21 | ; 22 | 23 | setGroupAlias : 24 | KW_ALTER KW_GROUP type=groupType qualifiedName setAliasedName 25 | ; 26 | 27 | setGroupComment: 28 | KW_ALTER KW_GROUP type=groupType qualifiedName alterStatementSuffixSetComment 29 | ; 30 | setGroupProperties: 31 | KW_ALTER KW_GROUP type=groupType qualifiedName KW_SET setProperties 32 | ; 33 | dropGroup: 34 | KW_DROP KW_GROUP type=groupType qualifiedName 35 | ; 36 | renameGroup 37 | : KW_ALTER KW_GROUP type=groupType qualifiedName alterStatementSuffixRename 38 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/ImpExpParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar ImpExpParser; 2 | 3 | impExpStatements: 4 | exportStatement 5 | ; 6 | 7 | 8 | exportStatement 9 | : (KW_EXP | KW_EXPORT) exportBusinessUnit? exportOutput exportTarget? KW_WHERE expression 10 | ; 11 | 12 | 13 | exportOutput 14 | : KW_OUTPUT EQUAL string 15 | ; 16 | 17 | exportBusinessUnit 18 | : identifier 19 | ; 20 | 21 | exportTarget 22 | : KW_TARGET EQUAL string 23 | ; 24 | -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/MeasureUnitParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar MeasureUnitParser; 2 | measureUnitStatements 3 | : createMeasureUnit 4 | | renameMeasureUnit 5 | | setMeasureUnitComment 6 | | setMeasureUnitProperties 7 | | dropMeasureUnit 8 | | setMeasureUnitAlias 9 | ; 10 | createMeasureUnit: 11 | KW_CREATE replace? KW_MEASUREUNIT ifNotExists? qualifiedName alias? comment? (KW_WITH setProperties)? 12 | ; 13 | renameMeasureUnit: 14 | KW_ALTER KW_MEASUREUNIT qualifiedName alterStatementSuffixRename; 15 | 16 | setMeasureUnitComment: 17 | KW_ALTER KW_MEASUREUNIT qualifiedName alterStatementSuffixSetComment 18 | ; 19 | 20 | setMeasureUnitProperties: 21 | KW_ALTER KW_MEASUREUNIT qualifiedName KW_SET setProperties 22 | ; 23 | 24 | dropMeasureUnit: 25 | KW_DROP KW_MEASUREUNIT ifExists? qualifiedName 26 | ; 27 | 28 | setMeasureUnitAlias: 29 | KW_ALTER KW_MEASUREUNIT qualifiedName setAliasedName 30 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/PipeParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar PipeParser; 2 | 3 | pipeStatements : 4 | createPipe 5 | ; 6 | 7 | createPipe : 8 | KW_CREATE replace? pipeType? KW_PIPE ifNotExists? 9 | qualifiedName alias? comment? 10 | (KW_WITH setProperties)? 11 | KW_AS 12 | copyIntoFrom 13 | ; 14 | 15 | 16 | copyIntoFrom : 17 | KW_COPY KW_INTO 18 | targetType 19 | (KW_WITH copy=keyValuePairs)? 20 | KW_FROM tableName 21 | KW_WHERE 22 | expression 23 | ; 24 | 25 | 26 | 27 | keyValuePairs : 28 | LPAREN 29 | keyValue (COMMA keyValue)* 30 | RPAREN 31 | ; 32 | keyValue : 33 | pipeKey EQUAL constant 34 | ; 35 | 36 | targetType: 37 | KW_TABLE 38 | | KW_DICT 39 | ; 40 | 41 | pipeType: 42 | KW_SYNC 43 | | KW_ASYNC 44 | ; 45 | 46 | pipeKey : 47 | KW_TARGET 48 | | KW_COPY_MODE 49 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/ReferencesParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar ReferencesParser; 2 | 3 | referencesStatements : 4 | showReferences 5 | | moveReferences 6 | ; 7 | 8 | moveReferences : 9 | KW_MOVE showType KW_REFERENCES KW_FROM from=qualifiedName KW_TO to=qualifiedName (KW_WITH setProperties)? 10 | ; 11 | 12 | showReferences : 13 | KW_SHOW showType KW_REFERENCES KW_FROM from=qualifiedName (KW_WITH setProperties)? 14 | ; -------------------------------------------------------------------------------- /fastmodel-parser/src/main/antlr4/imports/ScriptParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar ScriptParser; 2 | 3 | scriptStatements: 4 | importEntityStatement | refEntityStatement 5 | ; 6 | 7 | importEntityStatement 8 | : KW_IMPORT qualifiedName (KW_AS identifier)? 9 | ; 10 | 11 | refEntityStatement 12 | : KW_REF leftTable=tableNameList leftTableComment=comment? refRelationType rightTable=tableNameList rightTableComent=comment? (COLON name=identifier)? 13 | ; 14 | 15 | 16 | refRelationType: 17 | GREATERTHAN? LEFT_DIRECTION_RIGHT 18 | | RIGHT_DIRECTON_LEFT LESSTHAN? 19 | ; 20 | 21 | 22 | -------------------------------------------------------------------------------- /fastmodel-parser/src/test/resources/lsp/highlight.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/fastmodel-parser/src/test/resources/lsp/highlight.json -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/java/com/aliyun/fastmodel/transform/adbmysql/builder/DefaultBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.adbmysql.builder; 2 | 3 | import com.aliyun.fastmodel.core.tree.BaseStatement; 4 | import com.aliyun.fastmodel.core.tree.QualifiedName; 5 | import com.aliyun.fastmodel.core.tree.statement.table.CreateTable; 6 | import com.aliyun.fastmodel.transform.adbmysql.context.AdbMysqlTransformContext; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2023/2/13 14 | */ 15 | public class DefaultBuilderTest { 16 | 17 | @Test 18 | public void testBuild() { 19 | DefaultBuilder defaultBuilder = new DefaultBuilder(); 20 | BaseStatement source = CreateTable.builder().tableName(QualifiedName.of("abc")).build(); 21 | defaultBuilder.build(source, AdbMysqlTransformContext.builder().build()); 22 | } 23 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/java/com/aliyun/fastmodel/transform/adbmysql/client/property/AdbMysqlPropertyKeyTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.adbmysql.client.property; 2 | 3 | import com.aliyun.fastmodel.transform.adbmysql.format.AdbMysqlPropertyKey; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertNull; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2023/2/12 13 | */ 14 | public class AdbMysqlPropertyKeyTest { 15 | 16 | @Test 17 | public void testGetNull() { 18 | AdbMysqlPropertyKey propertyKey = AdbMysqlPropertyKey.getByValue("not"); 19 | assertNull(propertyKey); 20 | } 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/adbmysql_date_format.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `testdb_t_parameter_bak_1123` ( 2 | `id` bigint NOT NULL COMMENT '主键', 3 | `name` varchar(128) COMMENT '', 4 | `value` varchar COMMENT '', 5 | `status` varchar(16) COMMENT '有效标志,on/off', 6 | `description` varchar(256) COMMENT '描述', 7 | `create_time` datetime NOT NULL COMMENT '创建时间', 8 | `create_user` varchar(128) COMMENT '创建者', 9 | `modify_time` datetime COMMENT '修改时间', 10 | `modify_user` varchar(128) COMMENT '修改人', 11 | `col1` varchar(100) COMMENT '', 12 | `col2` varchar(100) COMMENT '', 13 | PRIMARY KEY (`id`,`create_time`) 14 | ) DISTRIBUTED BY HASH(`id`) 15 | PARTITION BY VALUE(`date_format(create_time, '%Y%M%d')`) 16 | LIFECYCLE 10 INDEX_ALL='Y' 17 | STORAGE_POLICY='HOT' ENGINE='XUANWU' 18 | BLOCK_SIZE=8192 19 | TABLE_PROPERTIES='{"format":"columnstore"}' 20 | COMMENT='配置表' -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/adbmysql_date_format_result.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE testdb_t_parameter_bak_1123 2 | ( 3 | id BIGINT NOT NULL COMMENT '主键', 4 | name VARCHAR(128) NULL COMMENT '', 5 | value VARCHAR NULL COMMENT '', 6 | status VARCHAR(16) NULL COMMENT '有效标志,on/off', 7 | description VARCHAR(256) NULL COMMENT '描述', 8 | create_time DATETIME NOT NULL COMMENT '创建时间', 9 | create_user VARCHAR(128) NULL COMMENT '创建者', 10 | modify_time DATETIME NULL COMMENT '修改时间', 11 | modify_user VARCHAR(128) NULL COMMENT '修改人', 12 | col1 VARCHAR(100) NULL COMMENT '', 13 | col2 VARCHAR(100) NULL COMMENT '', 14 | PRIMARY KEY(id,create_time) 15 | ) 16 | DISTRIBUTED BY HASH(id) 17 | PARTITION BY VALUE(date_format(create_time, '%Y%M%d')) LIFECYCLE 10 18 | INDEX_ALL='Y' 19 | STORAGE_POLICY='HOT' 20 | ENGINE='XUANWU' 21 | BLOCK_SIZE=8192 22 | TABLE_PROPERTIES='{"format":"columnstore"}' 23 | COMMENT '配置表' -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/hudi.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE IF NOT EXISTS adb_external_demo.osstest2 2 | (id int, 3 | name string, 4 | age int, 5 | city string) 6 | STORED AS HUDI 7 | LOCATION 'oss://testBucketName/osstest/test' 8 | TBLPROPERTIES ('type' = 'cow'); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/maxcompute.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE IF NOT EXISTS adb_external_demo.mctest ( 2 | id int, 3 | name varchar(1023), 4 | age int, 5 | dt string 6 | ) ENGINE='ODPS' 7 | TABLE_PROPERTIES='{ 8 | "accessid":"LTAILd4****", 9 | "endpoint":"http://service.cn-hangzhou.maxcompute.aliyun.com/api", 10 | "accesskey":"4A5Q7ZVzcYnWMQPysX****", 11 | "partition_column":"dt", 12 | "project_name":"test_adb", 13 | "table_name":"person" 14 | }'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/mongodb.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE adb_external_demo.person ( 2 | id int, 3 | age int 4 | ) ENGINE = 'MONGODB' 5 | TABLE_PROPERTIES ='{ 6 | "mapped_name":"person", 7 | "location":"mongodb://testuser:****@dds-bp113d414bca8****.mongodb.rds.aliyuncs.com:3717,dds-bp113d414bca8****.mongodb.rds.aliyuncs.com:3717/test_mongodb", 8 | "username":"testuser", 9 | "password":"password", 10 | }'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/ots.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE IF NOT EXISTS adb_external_demo.otstest ( 2 | id int, 3 | name string, 4 | age int 5 | ) ENGINE = 'OTS' 6 | TABLE_PROPERTIES = '{ 7 | "mapped_name":"person", 8 | "location":"https://w0****la.cn-hangzhou.vpc.tablestore.aliyuncs.com" 9 | }'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/rds.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE IF NOT EXISTS adb_external_demo.mysqltest ( 2 | id int, 3 | name varchar(1023), 4 | age int 5 | ) ENGINE = 'MYSQL' 6 | TABLE_PROPERTIES = '{ 7 | "url":"jdbc:mysql://rm-bp1gx6h1tyd04****.mysql.rds.aliyuncs.com:3306/test_adb", 8 | "tablename":"person", 9 | "username":"testUserName", 10 | "password":"testUserPassword", 11 | "charset":"utf8" 12 | }'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/external/textfile.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE IF NOT EXISTS adb_external_demo.osstest1 2 | (id int, 3 | name string, 4 | age int, 5 | city string) 6 | ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 7 | STORED AS TEXTFILE 8 | LOCATION 'oss://testBucketName/osstest/p1=hangzhou/p2=2023-06-13/data.csv'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/ann.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE vector ( 2 | xid bigint not null, 3 | cid bigint not null, 4 | uid varchar not null, 5 | vid varchar not null, 6 | wid varchar not null, 7 | float_feature array(4), 8 | short_feature array(4), 9 | ANN INDEX idx_short_feature(short_feature), 10 | ANN INDEX idx_float_feature(float_feature), 11 | PRIMARY KEY (xid, cid, vid) 12 | ) DISTRIBUTED BY HASH(xid); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/cluster.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE clustered_test( 2 | id int, 3 | vj json, 4 | CLUSTERED KEY c(id) 5 | ) 6 | DISTRIBUTED BY HASH(id); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/foreign.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE store_returns 2 | ( 3 | sr_sale_id bigint, 4 | sr_store_sk bigint, 5 | sr_item_sk bigint NOT NULL, 6 | FOREIGN KEY (sr_item_sk) REFERENCES item (i_item_sk) 7 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/fulltext.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `tbl_fulltext_demo` ( 2 | `id` int, 3 | `content` varchar, 4 | `content_alinlp` varchar, 5 | `content_ik` varchar, 6 | `content_standard` varchar, 7 | `content_ngram` varchar, 8 | FULLTEXT INDEX fidx_c(`content`), 9 | FULLTEXT INDEX fidx_alinlp(`content_alinlp`) WITH ANALYZER alinlp, 10 | FULLTEXT INDEX fidx_ik(`content_ik`) WITH ANALYZER ik, 11 | FULLTEXT INDEX fidx_standard(`content_standard`) WITH ANALYZER standard, 12 | FULLTEXT INDEX fidx_ngram(`content_ngram`) WITH ANALYZER ngram, 13 | PRIMARY KEY (`id`) 14 | ) DISTRIBUTED BY HASH(id); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/json.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE json_test( 2 | id int, 3 | vj json, 4 | index idx_vj_array(vj->'$[*]') 5 | ) 6 | DISTRIBUTED BY HASH(id); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/index/json2.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE json_test( 2 | id int, 3 | vj json, 4 | index idx_vj(vj) 5 | ) 6 | DISTRIBUTED BY HASH(id); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/issue.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `di_ide_yufa_t_parameter` ( 2 | `id` bigint NOT NULL COMMENT '主键', 3 | `name` varchar(128) COMMENT '', 4 | `value` varchar COMMENT '', 5 | `status` varchar(16) COMMENT '有效标志,on/off', 6 | `description` varchar(256) COMMENT '描述', 7 | `create_time` datetime COMMENT '创建时间', 8 | `create_user` varchar(128) COMMENT '创建者', 9 | `modify_time` datetime COMMENT '修改时间', 10 | `modify_user` varchar(128) COMMENT '修改人', 11 | PRIMARY KEY (`id`) 12 | ) DISTRIBUTED BY HASH(`id`) PARTITION BY VALUE(`id`) LIFECYCLE 36500 INDEX_ALL='Y' STORAGE_POLICY='HOT' ENGINE='XUANWU' BLOCK_SIZE=8192 TABLE_PROPERTIES='{"format":"columnstore"}' COMMENT='配置表' -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/issue2.txt: -------------------------------------------------------------------------------- 1 | Create Table `ADB_EXTERNAL_TPCH_10GB`.`External_customer` 2 | ( 3 | `c_custkey` int NOT NULL COMMENT '', 4 | `c_name` varchar(1024) NOT NULL COMMENT '', 5 | `c_address` varchar(1024) NOT NULL COMMENT '', 6 | `c_nationkey` int NOT NULL COMMENT '', 7 | `c_phone` varchar(15) NOT NULL COMMENT '', 8 | `c_acctbal` decimal(15, 2) NOT NULL COMMENT '', 9 | `c_mktsegment` varchar(10) NOT NULL COMMENT '', 10 | `c_comment` varchar(1024) NOT NULL COMMENT '', 11 | `dummy` varchar(1024) 12 | ) 13 | ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' 14 | STORED AS `TEXTFILE` 15 | LOCATION 'oss://dataset-cn-shanghai-external/customer/' ; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/issue_full_type.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `table02` ( 2 | `__adb_auto_id__` bigint AUTO_INCREMENT, 3 | `c1` boolean COMMENT 'id', 4 | `c2` tinyint COMMENT '', 5 | `c3` smallint COMMENT '', 6 | `c4` int COMMENT '', 7 | `c5` int COMMENT '', 8 | `c6` bigint COMMENT '', 9 | `c7` float COMMENT '', 10 | `c8` double COMMENT '', 11 | `c9` decimal(10, 2) COMMENT '', 12 | `c10` decimal(10, 0) COMMENT '', 13 | `c11` varchar(10) COMMENT '', 14 | `c12` binary COMMENT '', 15 | `c13` date COMMENT '', 16 | `c14` time COMMENT '', 17 | `c15` datetime COMMENT '', 18 | `c16` timestamp COMMENT '', 19 | `c17` point delimiter_tokenizer ' ' COMMENT '', 20 | `c18` array COMMENT '', 21 | `c19` map COMMENT '', 22 | `c20` json COMMENT '', 23 | PRIMARY KEY (`__adb_auto_id__`) 24 | ) DISTRIBUTE BY HASH(`__adb_auto_id__`) INDEX_ALL='Y' STORAGE_POLICY='HOT' ENGINE='XUANWU' TABLE_PROPERTIES='{"format":"columnstore"}' COMMENT='table comment'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/simple.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE customer ( 2 | customer_id bigint NOT NULL COMMENT '顾客ID', 3 | customer_name varchar NOT NULL COMMENT '顾客姓名', 4 | phone_num bigint NOT NULL COMMENT '电话', 5 | city_name varchar NOT NULL COMMENT '所属城市', 6 | sex int NOT NULL COMMENT '性别', 7 | id_number varchar NOT NULL COMMENT '身份证号码', 8 | home_address varchar NOT NULL COMMENT '家庭住址', 9 | office_address varchar NOT NULL COMMENT '办公地址', 10 | age int NOT NULL COMMENT '年龄', 11 | login_time timestamp NOT NULL COMMENT '登录时间', 12 | PRIMARY KEY (login_time, customer_id, phone_num) 13 | ) 14 | DISTRIBUTED BY HASH(customer_id) 15 | PARTITION BY VALUE(DATE_FORMAT(login_time, '%Y%m%d')) LIFECYCLE 30 16 | COMMENT '客户信息表'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/simple_db.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE db.customer ( 2 | customer_id bigint NOT NULL COMMENT '顾客ID', 3 | customer_name varchar NOT NULL COMMENT '顾客姓名', 4 | phone_num bigint NOT NULL COMMENT '电话', 5 | city_name varchar NOT NULL COMMENT '所属城市', 6 | sex int NOT NULL COMMENT '性别', 7 | id_number varchar NOT NULL COMMENT '身份证号码', 8 | home_address varchar NOT NULL COMMENT '家庭住址', 9 | office_address varchar NOT NULL COMMENT '办公地址', 10 | age int NOT NULL COMMENT '年龄', 11 | login_time timestamp NOT NULL COMMENT '登录时间', 12 | PRIMARY KEY (login_time, customer_id, phone_num) 13 | ) 14 | DISTRIBUTED BY HASH(customer_id) 15 | PARTITION BY VALUE(DATE_FORMAT(login_time, '%Y%m%d')) LIFECYCLE 30 16 | COMMENT '客户信息表'; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbmysql/src/test/resources/adbmysql/simple_result.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE customer 2 | ( 3 | customer_id BIGINT NOT NULL COMMENT '顾客ID', 4 | customer_name VARCHAR NOT NULL COMMENT '顾客姓名', 5 | phone_num BIGINT NOT NULL COMMENT '电话', 6 | city_name VARCHAR NOT NULL COMMENT '所属城市', 7 | sex INT NOT NULL COMMENT '性别', 8 | id_number VARCHAR NOT NULL COMMENT '身份证号码', 9 | home_address VARCHAR NOT NULL COMMENT '家庭住址', 10 | office_address VARCHAR NOT NULL COMMENT '办公地址', 11 | age INT NOT NULL COMMENT '年龄', 12 | login_time TIMESTAMP NOT NULL COMMENT '登录时间', 13 | PRIMARY KEY(login_time,customer_id,phone_num) 14 | ) 15 | DISTRIBUTED BY HASH(customer_id) 16 | PARTITION BY VALUE(date_format(login_time, '%Y%m%d')) LIFECYCLE 30 17 | COMMENT '客户信息表' -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/basic.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE baby.rank ( 2 | id int, rank int, year smallint, gender char(1), count int 3 | ) 4 | DISTRIBUTED BY (rank, gender, year); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/default.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE distributors ( 2 | did integer PRIMARY KEY DEFAULT nextval('serial'), 3 | name varchar(40) NOT NULL CHECK (name <> '') 4 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/films.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE films ( 2 | code char(5) CONSTRAINT firstkey PRIMARY KEY, 3 | title varchar(40) NOT NULL, 4 | did integer NOT NULL, 5 | date_prod date, 6 | kind varchar(10), 7 | len interval hour to minute 8 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/partition_by.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE sales (id int, year int, qtr int, c_rank int, code char(1), region text) 2 | DISTRIBUTED BY (id) 3 | PARTITION BY LIST (code) 4 | ( PARTITION sales VALUES ('S'), 5 | PARTITION returns VALUES ('R') 6 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/property.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE sales (txn_id int, qty int, date date) 2 | WITH (appendoptimized=true, compresslevel=5) 3 | DISTRIBUTED BY (txn_id); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/sub_partition_by.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE sales (id int, year int, qtr int, c_rank int, code char(1), region text) 2 | DISTRIBUTED BY (id) 3 | PARTITION BY LIST (code) 4 | SUBPARTITION BY RANGE (c_rank) 5 | SUBPARTITION by LIST (region) 6 | 7 | ( PARTITION sales VALUES ('S') 8 | ( SUBPARTITION cr1 START (1) END (2) 9 | ( SUBPARTITION ca VALUES ('CA') ), 10 | SUBPARTITION cr2 START (3) END (4) 11 | ( SUBPARTITION ca VALUES ('CA') ) ), 12 | 13 | PARTITION returns VALUES ('R') 14 | ( SUBPARTITION cr1 START (1) END (2) 15 | ( SUBPARTITION ca VALUES ('CA') ), 16 | SUBPARTITION cr2 START (3) END (4) 17 | ( SUBPARTITION ca VALUES ('CA') ) ) 18 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-adbpg/src/test/resources/adbpostgresql/sub_partition_with_template.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE sales (id int, year int, qtr int, c_rank int, code char(1), region text) 2 | DISTRIBUTED BY (id) 3 | PARTITION BY RANGE (year) 4 | 5 | SUBPARTITION BY RANGE (qtr) 6 | SUBPARTITION TEMPLATE ( 7 | START (1) END (5) EVERY (1), 8 | DEFAULT SUBPARTITION bad_qtr ) 9 | 10 | SUBPARTITION BY LIST (region) 11 | SUBPARTITION TEMPLATE ( 12 | SUBPARTITION usa VALUES ('usa'), 13 | SUBPARTITION europe VALUES ('europe'), 14 | SUBPARTITION asia VALUES ('asia'), 15 | DEFAULT SUBPARTITION other_regions) 16 | 17 | ( START (2009) END (2011) EVERY (1), 18 | DEFAULT PARTITION outlying_years); 19 | 20 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/PropertyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.client; 10 | 11 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 12 | 13 | /** 14 | * PropertyConverter 15 | * 16 | * @author panguanjing 17 | * @date 2022/6/29 18 | */ 19 | public interface PropertyConverter { 20 | /** 21 | * 根据name和value获取baseClientProperty 22 | * 23 | * @param name 24 | * @param value 25 | * @return 26 | */ 27 | default BaseClientProperty create(String name, String value) { 28 | throw new UnsupportedOperationException(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/constraint/ConstraintType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.client.dto.constraint; 10 | 11 | /** 12 | * 约束类型 13 | * 14 | * @author panguanjing 15 | * @date 2022/6/7 16 | */ 17 | public interface ConstraintType { 18 | /** 19 | * 类型名字 20 | * 21 | * @return 22 | */ 23 | String getCode(); 24 | } 25 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/index/Index.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.client.dto.index; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * Index 索引 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/19 16 | */ 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | @Data 21 | public class Index { 22 | /** 23 | * 索引名称 24 | */ 25 | private String name; 26 | 27 | /** 28 | * 列 29 | */ 30 | private List indexKeys; 31 | 32 | 33 | /** 34 | * client properties 35 | */ 36 | private List properties; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/index/IndexKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.client.dto.index; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * 索引key定义 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/19 13 | */ 14 | @Data 15 | @Builder 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class IndexKey { 19 | /** 20 | * 列 21 | */ 22 | private String column; 23 | /** 24 | * 表达式 25 | */ 26 | private String expression; 27 | /** 28 | * 长度 29 | */ 30 | private Long length; 31 | /** 32 | * 排序类型 33 | */ 34 | private IndexSortType sortType; 35 | } 36 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/index/IndexSortType.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.client.dto.index; 2 | 3 | /** 4 | * sort type 5 | */ 6 | public enum IndexSortType { 7 | ASC, 8 | DESC 9 | } 10 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/property/StringProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.client.dto.property; 10 | 11 | /** 12 | * string property 13 | * 14 | * @author panguanjing 15 | * @date 2022/6/7 16 | */ 17 | public class StringProperty extends BaseClientProperty { 18 | @Override 19 | public String valueString() { 20 | return this.getValue(); 21 | } 22 | 23 | @Override 24 | public void setValueString(String value) { 25 | this.setValue(value); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/client/dto/result/DdlTableResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.client.dto.result; 10 | 11 | import com.aliyun.fastmodel.transform.api.client.dto.table.Table; 12 | import lombok.AllArgsConstructor; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | /** 17 | * ddl table result 18 | * 19 | * @author panguanjing 20 | * @date 2022/6/16 21 | */ 22 | @Data 23 | @NoArgsConstructor 24 | @AllArgsConstructor 25 | public class DdlTableResult { 26 | 27 | /** 28 | * result table 29 | */ 30 | private Table table; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/context/setting/QuerySetting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.context.setting; 10 | 11 | import lombok.AllArgsConstructor; 12 | import lombok.Builder; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | /** 17 | * query convert context 18 | * 19 | * @author panguanjing 20 | * @date 2022/7/2 21 | */ 22 | @Builder 23 | @Data 24 | @NoArgsConstructor 25 | @AllArgsConstructor 26 | public class QuerySetting { 27 | /** 28 | * 转换时是否仍然保留schema,默认是false,不保留 29 | */ 30 | private boolean keepSchemaName; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/datatype/simple/ISimpleDataTypeName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.datatype.simple; 10 | 11 | import com.aliyun.fastmodel.core.tree.datatype.IDataTypeName; 12 | 13 | /** 14 | * 简单数据类型名称 15 | * @author panguanjing 16 | * @date 2022/11/7 17 | */ 18 | public interface ISimpleDataTypeName extends IDataTypeName { 19 | /** 20 | * 转换为simple dataType 21 | * @return 22 | */ 23 | SimpleDataTypeName getSimpleDataTypeName(); 24 | } 25 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/dialect/IDialectName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.dialect; 10 | 11 | /** 12 | * iDialectName 13 | * 14 | * @author panguanjing 15 | * @date 2022/6/16 16 | */ 17 | public interface IDialectName { 18 | /** 19 | * 获取名字 20 | * 21 | * @return 22 | */ 23 | String getName(); 24 | } 25 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/dialect/IVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.api.dialect; 10 | 11 | import org.apache.commons.lang3.StringUtils; 12 | 13 | /** 14 | * version 15 | * 16 | * @author panguanjing 17 | * @date 2022/6/16 18 | */ 19 | public interface IVersion { 20 | IVersion DEFAULT_VERSION = () -> StringUtils.EMPTY; 21 | 22 | /** 23 | * get version name 24 | * 25 | * @return 26 | */ 27 | String getName(); 28 | 29 | /** 30 | * 获取default 31 | * 32 | * @return 33 | */ 34 | static IVersion getDefault() { 35 | return DEFAULT_VERSION; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/domain/DomainObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.transform.api.domain; 18 | 19 | /** 20 | * DomainObject 21 | * 22 | * @author panguanjing 23 | * @date 2021/12/12 24 | */ 25 | public interface DomainObject { 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/domain/ValueObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.transform.api.domain; 18 | 19 | /** 20 | * ValueObject 21 | * 22 | * @author panguanjing 23 | * @date 2021/12/23 24 | */ 25 | public interface ValueObject { 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/constraint/DistributeClientConstraint.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.constraint; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.constraint.Constraint; 4 | import lombok.Data; 5 | import lombok.EqualsAndHashCode; 6 | 7 | /** 8 | * DistributeClientConstraint 9 | * 10 | * @author panguanjing 11 | * @date 2023/12/15 12 | */ 13 | @EqualsAndHashCode(callSuper = true) 14 | @Data 15 | public class DistributeClientConstraint extends Constraint { 16 | /** 17 | * 是否random 18 | */ 19 | private Boolean random; 20 | 21 | /** 22 | * bucket 23 | */ 24 | private Integer bucket; 25 | 26 | public DistributeClientConstraint() { 27 | this.setType(ExtensionClientConstraintType.DISTRIBUTE); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/constraint/UniqueKeyExprClientConstraint.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.constraint; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.constraint.Constraint; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * unique key expr constraint 11 | * 12 | * @author panguanjing 13 | * @date 2024/2/19 14 | */ 15 | @EqualsAndHashCode(callSuper = true) 16 | @Data 17 | public class UniqueKeyExprClientConstraint extends Constraint { 18 | 19 | /** 20 | * expressions 21 | */ 22 | private List expression; 23 | 24 | public UniqueKeyExprClientConstraint() { 25 | this.setType(ExtensionClientConstraintType.UNIQUE_KEY); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/index/IndexCommentProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.index; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 4 | 5 | import static com.aliyun.fastmodel.transform.api.extension.client.property.ExtensionPropertyKey.TABLE_INDEX_COMMENT; 6 | 7 | /** 8 | * 索引描述信息属性 9 | * 10 | * @author panguanjing 11 | * @date 2023/12/18 12 | */ 13 | public class IndexCommentProperty extends BaseClientProperty { 14 | 15 | public IndexCommentProperty() { 16 | setKey(TABLE_INDEX_COMMENT.getValue()); 17 | } 18 | 19 | @Override 20 | public String valueString() { 21 | return value; 22 | } 23 | 24 | @Override 25 | public void setValueString(String value) { 26 | this.setValue(value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/index/IndexTypeProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.index; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 4 | 5 | import static com.aliyun.fastmodel.transform.api.extension.client.property.ExtensionPropertyKey.TABLE_INDEX_TYPE; 6 | 7 | /** 8 | * 索引描述信息属性 9 | * 10 | * @author panguanjing 11 | * @date 2023/12/18 12 | */ 13 | public class IndexTypeProperty extends BaseClientProperty { 14 | 15 | public IndexTypeProperty() { 16 | setKey(TABLE_INDEX_TYPE.getValue()); 17 | } 18 | 19 | @Override 20 | public String valueString() { 21 | return value; 22 | } 23 | 24 | @Override 25 | public void setValueString(String value) { 26 | this.setValue(value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/TablePartitionRaw.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 4 | 5 | import static com.aliyun.fastmodel.transform.api.extension.client.property.ExtensionPropertyKey.TABLE_PARTITION_RAW; 6 | 7 | /** 8 | * 分区定义的文本化描述 9 | * 10 | * @author panguanjing 11 | * @date 2023/9/20 12 | */ 13 | public class TablePartitionRaw extends BaseClientProperty { 14 | 15 | public TablePartitionRaw() { 16 | this.setKey(TABLE_PARTITION_RAW.getValue()); 17 | } 18 | 19 | @Override 20 | public String valueString() { 21 | return this.value; 22 | } 23 | 24 | @Override 25 | public void setValueString(String value) { 26 | this.value = value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/ArrayClientPartitionKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * ArrayClientPartitionKey 13 | * 14 | * @author panguanjing 15 | * @date 2023/10/17 16 | */ 17 | @EqualsAndHashCode(callSuper = true) 18 | @Data 19 | @Builder 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class ArrayClientPartitionKey extends BaseClientPartitionKey { 23 | 24 | private List> partitionValue; 25 | } 26 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/LessThanClientPartitionKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * Desc: 13 | * 14 | * @author panguanjing 15 | * @date 2023/10/16 16 | */ 17 | @EqualsAndHashCode(callSuper = true) 18 | @Data 19 | @Builder 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class LessThanClientPartitionKey extends BaseClientPartitionKey { 23 | 24 | private boolean maxValue; 25 | 26 | private List partitionValueList; 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/ListClientPartition.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * list partition value 10 | * 11 | * @author 子梁 12 | * @date 2023/12/25 13 | */ 14 | @Data 15 | @Builder 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class ListClientPartition { 19 | 20 | /** 21 | * partition name 22 | */ 23 | private String name; 24 | 25 | /** 26 | * partition key 27 | */ 28 | private BaseClientPartitionKey partitionKey; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/MultiRangeClientPartition.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import com.aliyun.fastmodel.core.tree.expr.enums.DateTimeEnum; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * multi range partition value 11 | * 12 | * @author panguanjing 13 | */ 14 | @Data 15 | @Builder 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class MultiRangeClientPartition { 19 | /** 20 | * start 21 | */ 22 | private String start; 23 | /** 24 | * end 25 | */ 26 | private String end; 27 | /** 28 | * interval 29 | */ 30 | private Long interval; 31 | /** 32 | * time enum 33 | */ 34 | private DateTimeEnum dateTimeEnum; 35 | } 36 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/PartitionClientValue.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2023/10/23 13 | */ 14 | @Data 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class PartitionClientValue { 19 | /** 20 | * max value 21 | */ 22 | private boolean maxValue; 23 | /** 24 | * value 25 | */ 26 | private String value; 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/SingleRangeClientPartition.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import java.util.LinkedHashMap; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * range partition value 12 | * 13 | * @author panguanjing 14 | */ 15 | @Data 16 | @Builder 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | public class SingleRangeClientPartition { 20 | /** 21 | * column name 22 | */ 23 | private String name; 24 | /** 25 | * if not exists 26 | */ 27 | private boolean ifNotExists; 28 | /** 29 | * partition key 30 | */ 31 | private BaseClientPartitionKey partitionKey; 32 | /** 33 | * properties 34 | */ 35 | private LinkedHashMap properties; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/client/property/table/partition/v1/TimeExpressionClientPartition.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1; 2 | 3 | import com.aliyun.fastmodel.core.tree.expr.literal.IntervalLiteral; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * expression partition 11 | * 12 | * @author 子梁 13 | * @date 2023/12/26 14 | */ 15 | @Data 16 | @Builder 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | public class TimeExpressionClientPartition { 20 | 21 | /** 22 | * time function name 23 | */ 24 | private String funcName; 25 | 26 | /** 27 | * column 28 | */ 29 | private String column; 30 | 31 | /** 32 | * time unit 33 | */ 34 | private String timeUnit; 35 | 36 | /** 37 | * interval 38 | */ 39 | private IntervalLiteral interval; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/tree/column/AggregateDesc.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.tree.column; 2 | 3 | /** 4 | * column agg desc 5 | * 6 | * @author panguanjing 7 | * @date 2023/9/16 8 | */ 9 | public enum AggregateDesc { 10 | /** 11 | * sum 12 | */ 13 | SUM, 14 | /** 15 | * max 16 | */ 17 | MAX, 18 | /** 19 | * min 20 | */ 21 | MIN, 22 | /** 23 | * replace 24 | */ 25 | REPLACE, 26 | /** 27 | * hll union 28 | */ 29 | HLL_UNION, 30 | /** 31 | * bitmap union 32 | */ 33 | BITMAP_UNION, 34 | /** 35 | * percentile union 36 | */ 37 | PERCENTILE_UNION, 38 | /** 39 | * replace if not null 40 | */ 41 | REPLACE_IF_NOT_NULL; 42 | } 43 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/tree/constraint/Algorithm.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.tree.constraint; 2 | 3 | /** 4 | * Desc: 5 | * 6 | * @author panguanjing 7 | * @date 2024/2/19 8 | */ 9 | public enum Algorithm { 10 | BTREE, 11 | HASH 12 | } 13 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/tree/partition/desc/PartitionDesc.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.tree.partition.desc; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractNode; 4 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 5 | import com.aliyun.fastmodel.transform.api.extension.visitor.ExtensionAstVisitor; 6 | 7 | /** 8 | * RangePartition 9 | * 10 | * @author panguanjing 11 | * @date 2023/9/13 12 | */ 13 | public abstract class PartitionDesc extends AbstractNode { 14 | 15 | @Override 16 | public R accept(IAstVisitor visitor, C context) { 17 | ExtensionAstVisitor extensionVisitor = (ExtensionAstVisitor)visitor; 18 | return extensionVisitor.visitPartitionDesc(this, context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/extension/tree/partition/keyvalue/PartitionKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.extension.tree.partition.keyvalue; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractNode; 4 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 5 | import com.aliyun.fastmodel.transform.api.extension.visitor.ExtensionAstVisitor; 6 | 7 | /** 8 | * partition key 9 | * 10 | * @author panguanjing 11 | * @date 2023/9/13 12 | */ 13 | public abstract class PartitionKey extends AbstractNode { 14 | 15 | @Override 16 | public R accept(IAstVisitor visitor, C context) { 17 | ExtensionAstVisitor extensionVisitor = (ExtensionAstVisitor)visitor; 18 | return extensionVisitor.visitPartitionKey(this, context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/format/PropertyKey.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.format; 2 | 3 | /** 4 | * property key 5 | * 6 | * @author panguanjing 7 | * @date 2023/2/11 8 | */ 9 | public interface PropertyKey { 10 | 11 | /** 12 | * key name 13 | * 14 | * @return 15 | */ 16 | String getValue(); 17 | 18 | /** 19 | * 是否支持打印到property 20 | * 21 | * @return 22 | */ 23 | boolean isSupportPrint(); 24 | 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/main/java/com/aliyun/fastmodel/transform/api/format/PropertyValueType.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.format; 2 | 3 | /** 4 | * OptionValueType 5 | * 6 | * @author panguanjing 7 | * @date 2024/2/17 8 | */ 9 | public enum PropertyValueType { 10 | 11 | /** 12 | * EXPRESSION 13 | */ 14 | EXPRESSION, 15 | /** 16 | * identifier 17 | */ 18 | IDENTIFIER, 19 | /** 20 | * string literal 21 | */ 22 | STRING_LITERAL, 23 | 24 | /** 25 | * number literal 26 | */ 27 | NUMBER_LITERAL; 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-api/src/test/java/com/aliyun/fastmodel/transform/api/util/PropertyKeyUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.api.util; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * Desc: 7 | * 8 | * @author panguanjing 9 | * @date 2023/2/19 10 | */ 11 | public class PropertyKeyUtilTest { 12 | 13 | @Test 14 | public void testGetProperty() { 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/main/java/com/aliyun/fastmodel/transform/doris/client/DorisPropertyConverter.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.doris.client; 2 | 3 | import java.util.Map; 4 | import java.util.function.Function; 5 | 6 | import com.aliyun.fastmodel.transform.api.client.converter.BasePropertyConverter; 7 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 8 | import com.google.common.collect.Maps; 9 | 10 | /** 11 | * doris property converter 12 | * 13 | * @author panguanjing 14 | * @date 2024/1/21 15 | */ 16 | public class DorisPropertyConverter extends BasePropertyConverter { 17 | 18 | private static Map> functionMap = Maps.newHashMap(); 19 | 20 | public DorisPropertyConverter() { 21 | init(); 22 | } 23 | 24 | private void init() { 25 | 26 | } 27 | 28 | @Override 29 | protected Map> getFunctionMap() { 30 | return functionMap; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/main/java/com/aliyun/fastmodel/transform/doris/context/DorisContext.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.doris.context; 2 | 3 | import com.aliyun.fastmodel.transform.api.context.TransformContext; 4 | 5 | /** 6 | * doris context 7 | * 8 | * @author panguanjing 9 | * @date 2024/1/20 10 | */ 11 | public class DorisContext extends TransformContext { 12 | public DorisContext(TransformContext context) { 13 | super(context); 14 | } 15 | 16 | public DorisContext(Builder tBuilder) { 17 | super(tBuilder); 18 | } 19 | 20 | public static Builder builder() { 21 | return new Builder(); 22 | } 23 | 24 | public static class Builder extends TransformContext.Builder { 25 | 26 | @Override 27 | public DorisContext build() { 28 | return new DorisContext(this); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/main/java/com/aliyun/fastmodel/transform/doris/parser/visitor/DorisAstVisitor.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.doris.parser.visitor; 2 | 3 | import com.aliyun.fastmodel.transform.api.extension.visitor.ExtensionAstVisitor; 4 | import com.aliyun.fastmodel.transform.doris.parser.tree.DorisGenericDataType; 5 | 6 | /** 7 | * Desc: 8 | * 9 | * @author panguanjing 10 | * @date 2024/1/20 11 | */ 12 | public interface DorisAstVisitor extends ExtensionAstVisitor { 13 | default R visitDorisGenericDataType(DorisGenericDataType dorisGenericDataType, C context) { 14 | return visitGenericDataType(dorisGenericDataType, context); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/test/java/com/aliyun/fastmodel/transform/doris/parser/util/DorisReservedWordUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.doris.parser.util; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertFalse; 6 | import static org.junit.Assert.assertTrue; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2024/1/24 13 | */ 14 | public class DorisReservedWordUtilTest { 15 | 16 | @Test 17 | public void isReservedKeyWord() { 18 | boolean flag = DorisReservedWordUtil.isReservedKeyWord("add"); 19 | assertTrue(flag); 20 | flag = DorisReservedWordUtil.isReservedKeyWord("test"); 21 | assertFalse(flag); 22 | } 23 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/test/resources/doris/issue.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `realtime_test` ( 2 | `update_time` datetime NOT NULL COMMENT '创建时间', 3 | `id` bigint NOT NULL COMMENT 'id', 4 | `value` text NULL COMMENT '值', 5 | `comment` text NULL COMMENT '备注', 6 | `crete_time` datetime NOT NULL COMMENT '创建时间' 7 | ) ENGINE=OLAP 8 | UNIQUE KEY(`update_time`, `id`) 9 | COMMENT '测试表' 10 | AUTO PARTITION BY RANGE (date_trunc(`update_time`, 'day')) 11 | () 12 | DISTRIBUTED BY HASH(`id`) BUCKETS AUTO 13 | PROPERTIES ( 14 | "file_cache_ttl_seconds" = "0", 15 | "is_being_synced" = "false", 16 | "storage_medium" = "hdd", 17 | "storage_format" = "V2", 18 | "inverted_index_storage_format" = "V2", 19 | "enable_unique_key_merge_on_write" = "true", 20 | "light_schema_change" = "true", 21 | "disable_auto_compaction" = "false", 22 | "enable_single_replica_compaction" = "false", 23 | "group_commit_interval_ms" = "10000", 24 | "group_commit_data_bytes" = "134217728", 25 | "enable_mow_light_delete" = "false" 26 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/test/resources/doris/property.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `t_yunshi_holo_binlog_2_020601` ( 2 | `id` bigint(20) NOT NULL, 3 | `col1` text NULL, 4 | `col2` text NULL, 5 | `col3` text NULL 6 | ) ENGINE=OLAP 7 | UNIQUE KEY(`id`) 8 | COMMENT 'Auto created by DataWorks Data Integration' 9 | DISTRIBUTED BY HASH(`id`) BUCKETS 4 10 | PROPERTIES ( 11 | "replication_allocation" = "tag.location.default: 1", 12 | "in_memory" = "false", 13 | "storage_format" = "V2", 14 | "light_schema_change" = "true", 15 | "disable_auto_compaction" = "false" 16 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/test/resources/doris/range_error.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS yunshi_db.fml_raw_partition 2 | ( 3 | c1 TINYINT NOT NULL COMMENT "", 4 | c2 DATE NOT NULL COMMENT "", 5 | c3 INT NOT NULL COMMENT "", 6 | c4 STRING NULL COMMENT "" 7 | ) 8 | UNIQUE KEY (c1,c2,c3) 9 | COMMENT "" 10 | PARTITION BY RANGE (c2)() 11 | DISTRIBUTED BY HASH(c1,c2) BUCKETS 4 12 | PROPERTIES ("replication_num"="3"); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-doris/src/test/resources/doris/steppartition.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS abc 2 | ( 3 | c1 INT MIN NULL, 4 | c2 INT NOT NULL COMMENT "comment" 5 | ) 6 | COMMENT "comment" 7 | PARTITION BY RANGE (c2) 8 | ( 9 | FROM ("2020-01-01") TO ("2023-01-01") INTERVAL 1 DAY 10 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/main/resources/example/mysql.ddl.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE dim_demo 2 | ( 3 | c1 BIGINT NOT NULL COMMENT 'comment', 4 | c2 VARCHAR(128) NOT NULL COMMENT 'string', 5 | PRIMARY KEY(c1,c2) 6 | ); 7 | ALTER TABLE dim_demo ADD 8 | ( 9 | c3 DATETIME COMMENT 'date time' 10 | ); 11 | ALTER TABLE dim_demo DROP COLUMN c2; 12 | ALTER TABLE dim_demo ADD CONSTRAINT c1 PRIMARY KEY (c3) -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/main/resources/example/source.fml: -------------------------------------------------------------------------------- 1 | CREATE DIM TABLE dim_demo ALIAS 'alias' 2 | ( 3 | c1 BIGINT NOT NULL COMMENT 'comment', 4 | c2 STRING COMMENT 'string', 5 | primary key (c1, c2) 6 | ); 7 | ALTER TABLE dim_demo ADD COLUMNS(c3 DATETIME COMMENT 'date time'); 8 | ALTER TABLE dim_demo DROP COLUMN c2; 9 | ALTER TABLE dim_demo ADD CONSTRAINT c1 PRIMARY KEY (c3); 10 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddColNot.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"shop_code", 13 | "propertyType":"STRING", 14 | "ruleName":"字段规则-非空-(shop_code)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 17 | } 18 | ], 19 | "tableName":"dim_shop_test3" 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddColPrimary.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"shop_code", 13 | "propertyType":"STRING", 14 | "ruleName":"字段规则-唯一-(shop_code)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:duplicated_count:fixed:0" 17 | }, 18 | { 19 | "action":"ADD", 20 | "blockType":"BLOCK_WEAK", 21 | "expectValue":"0", 22 | "operator":"=", 23 | "predictType":"NOT_DYNAMIC", 24 | "property":"shop_code", 25 | "propertyType":"STRING", 26 | "ruleName":"字段规则-非空-(shop_code)", 27 | "ruleType":"TEMPLATE", 28 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 29 | } 30 | ], 31 | "tableName":"dim_shop_test3" 32 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddNotNull.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"test_code13", 13 | "propertyType":"STRING", 14 | "ruleName":"字段规则-非空-(test_code13)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 17 | } 18 | ], 19 | "tableName":"dim_shop_test25" 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddPrimaryKey.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"shop_code", 13 | "propertyType":"BIGINT", 14 | "ruleName":"字段规则-唯一-(shop_code)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:duplicated_count:fixed:0" 17 | } 18 | ], 19 | "tableName":"dim_shop_test3" 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddPrimaryKeyConstraintMore.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"col1,col2", 13 | "propertyType":"table", 14 | "ruleName":"表级规则-唯一-(col1,col2)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:fields:duplicated_count:fixed:0" 17 | } 18 | ], 19 | "tableName":"dim_shop" 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_AddPrimaryKeyConstraintOne.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"col1", 13 | "propertyType":"BIGINT", 14 | "ruleName":"字段规则-唯一-(col1)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:duplicated_count:fixed:0" 17 | } 18 | ], 19 | "tableName":"dim_shop" 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_ChangeColName.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"UPDATE", 8 | "oldProperty":"c1", 9 | "property":"c2" 10 | } 11 | ], 12 | "tableName":"dim_shop" 13 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_ChangeColNotNull.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "oldProperty":"old_col", 11 | "operator":"=", 12 | "predictType":"NOT_DYNAMIC", 13 | "property":"new_col", 14 | "propertyType":"STRING", 15 | "ruleName":"字段规则-非空-(new_col)", 16 | "ruleType":"TEMPLATE", 17 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 18 | } 19 | ], 20 | "tableName":"dim_shop" 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_ChangeColNull.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"DELETE", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "oldProperty":"old_col", 11 | "operator":"=", 12 | "predictType":"NOT_DYNAMIC", 13 | "property":"new_col", 14 | "propertyType":"STRING", 15 | "ruleName":"字段规则-非空-(old_col)", 16 | "ruleType":"TEMPLATE", 17 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 18 | } 19 | ], 20 | "tableName":"dim_shop" 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_ChangeColPrimary.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "oldProperty":"old_col", 11 | "operator":"=", 12 | "predictType":"NOT_DYNAMIC", 13 | "property":"new_col", 14 | "propertyType":"STRING", 15 | "ruleName":"字段规则-唯一-(new_col)", 16 | "ruleType":"TEMPLATE", 17 | "ruleValue":"SYSTEM:field:duplicated_count:fixed:0" 18 | }, 19 | { 20 | "action":"ADD", 21 | "blockType":"BLOCK_WEAK", 22 | "expectValue":"0", 23 | "oldProperty":"old_col", 24 | "operator":"=", 25 | "predictType":"NOT_DYNAMIC", 26 | "property":"new_col", 27 | "propertyType":"STRING", 28 | "ruleName":"字段规则-非空-(new_col)", 29 | "ruleType":"TEMPLATE", 30 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 31 | } 32 | ], 33 | "tableName":"dim_shop" 34 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_DropCol.json: -------------------------------------------------------------------------------- 1 | { 2 | "entityLevel":"SQL", 3 | "matchExpression":"NOTAPARTITIONTABLE", 4 | "ruleModelList":[ 5 | { 6 | "action":"DELETE", 7 | "property":"old_col" 8 | } 9 | ], 10 | "tableName":"dim_shop" 11 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_codeTable.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "checkerType":"FIX_STRATEGY_CHECK", 10 | "expectValue":"0", 11 | "operator":"=", 12 | "predictType":"NOT_DYNAMIC", 13 | "property":"USER_DEFINED", 14 | "propertyType":"user_defined", 15 | "ruleName":"字段规则-标准代码-(shop_code)", 16 | "ruleType":"SLEF_CUSTOM", 17 | "ruleValue":"SELECT count(*)\nFROM\n dim_shop_test25\nWHERE NOT (shop_code IN (SELECT code\nFROM\n code_test\n))\n" 18 | } 19 | ], 20 | "tableName":"dim_shop_test25" 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_createDqcRule.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"ADD", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "operator":"=", 11 | "predictType":"NOT_DYNAMIC", 12 | "property":"shop_code", 13 | "propertyType":"BIGINT", 14 | "ruleName":"字段规则-非空-(shop_code)", 15 | "ruleType":"TEMPLATE", 16 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 17 | }, 18 | { 19 | "action":"ADD", 20 | "blockType":"BLOCK_WEAK", 21 | "expectValue":"0", 22 | "operator":"=", 23 | "predictType":"NOT_DYNAMIC", 24 | "property":"shop_code", 25 | "propertyType":"BIGINT", 26 | "ruleName":"字段规则-唯一-(shop_code)", 27 | "ruleType":"TEMPLATE", 28 | "ruleValue":"SYSTEM:field:duplicated_count:fixed:0" 29 | } 30 | ], 31 | "tableName":"dim_shop_test47" 32 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-example/src/test/resources/expect_value_deleteNotNull.json: -------------------------------------------------------------------------------- 1 | { 2 | "dialectName":"MAXCOMPUTE", 3 | "entityLevel":"SQL", 4 | "matchExpression":"NOTAPARTITIONTABLE", 5 | "ruleModelList":[ 6 | { 7 | "action":"DELETE", 8 | "blockType":"BLOCK_WEAK", 9 | "expectValue":"0", 10 | "oldProperty":"test_code", 11 | "operator":"=", 12 | "predictType":"NOT_DYNAMIC", 13 | "property":"test_code", 14 | "propertyType":"STRING", 15 | "ruleName":"字段规则-非空-(test_code)", 16 | "ruleType":"TEMPLATE", 17 | "ruleValue":"SYSTEM:field:null_value:fixed:0" 18 | } 19 | ], 20 | "tableName":"dim_shop_test25" 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/java/com/aliyun/fastmodel/transform/flink/client/converter/FlinkPropertyConverter.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.flink.client.converter; 2 | 3 | import java.util.Map; 4 | import java.util.function.Function; 5 | 6 | import com.aliyun.fastmodel.transform.api.client.converter.BasePropertyConverter; 7 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 8 | import com.google.common.collect.Maps; 9 | 10 | /** 11 | * @author 子梁 12 | * @date 2024/5/22 13 | */ 14 | public class FlinkPropertyConverter extends BasePropertyConverter { 15 | 16 | private static Map> functionMap = Maps.newHashMap(); 17 | 18 | public FlinkPropertyConverter() { 19 | init(); 20 | } 21 | 22 | private void init() { 23 | 24 | } 25 | 26 | @Override 27 | protected Map> getFunctionMap() { 28 | return functionMap; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/java/com/aliyun/fastmodel/transform/flink/context/FlinkTransformContext.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.flink.context; 2 | 3 | import com.aliyun.fastmodel.transform.api.context.TransformContext; 4 | 5 | /** 6 | * @author 子梁 7 | * @date 2024/5/15 8 | */ 9 | public class FlinkTransformContext extends TransformContext { 10 | 11 | public FlinkTransformContext(TransformContext context) { 12 | super(context); 13 | } 14 | 15 | public FlinkTransformContext(Builder tBuilder) { 16 | super(tBuilder); 17 | } 18 | 19 | public static Builder builder() { 20 | return new Builder(); 21 | } 22 | 23 | public static class Builder extends TransformContext.Builder { 24 | 25 | @Override 26 | public FlinkTransformContext build() { 27 | return new FlinkTransformContext(this); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/resources/META-INF/maven/archetype.xml: -------------------------------------------------------------------------------- 1 | 2 | fastmodel-transform-flink 3 | 4 | src/main/java/App.java 5 | 6 | 7 | src/test/java/AppTest.java 8 | 9 | 10 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/resources/archetype-resources/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | $com.aliyun.fastmodel 5 | $fastmodel-transform-flink 6 | $0.5.13 7 | 8 | 9 | junit 10 | junit 11 | 3.8.1 12 | test 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/resources/archetype-resources/src/main/java/App.java: -------------------------------------------------------------------------------- 1 | package $com.aliyun.fastmodel; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-flink/src/main/resources/archetype-resources/src/test/java/AppTest.java: -------------------------------------------------------------------------------- 1 | package $com.aliyun.fastmodel; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-graph/src/main/java/com/aliyun/fastmodel/transform/graph/exporter/ExportName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.fastmodel.transform.graph.exporter; 18 | 19 | /** 20 | * JSON 21 | * 22 | * @author panguanjing 23 | * @date 2021/12/15 24 | */ 25 | public enum ExportName { 26 | /** 27 | * JSON 28 | */ 29 | JSON 30 | 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-graph/src/test/resources/test/graph.json: -------------------------------------------------------------------------------- 1 | {"edges":[{"attribute":{"left_comment":"comment","right_comment":"comment"},"id":"relname","label":"relname","source":"table","target":"table1"}],"nodes":[{"attribute":{"columns":[{"colAlias":"a1","colComment":null,"colName":"c1","colType":"DATE","isPartitionKey":null,"notNull":null,"primaryKey":null}],"name":null,"comment":"comment"},"id":"table","label":"table","vertexType":"DIM"},{"attribute":{"columns":[{"colAlias":"a1","colComment":null,"colName":"c1","colType":"DATE","isPartitionKey":null,"notNull":null,"primaryKey":null}],"name":null,"comment":"comment1"},"id":"table1","label":"table1","vertexType":"DIM"}]} -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hive/src/main/java/com/aliyun/fastmodel/transform/hive/client/property/FieldsTerminated.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.hive.client.property; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 4 | import com.aliyun.fastmodel.transform.hive.format.HivePropertyKey; 5 | 6 | /** 7 | * FieldsTerminated 8 | * 9 | * @author panguanjing 10 | * @date 2023/2/6 11 | */ 12 | public class FieldsTerminated extends BaseClientProperty { 13 | 14 | public FieldsTerminated() { 15 | this.setKey(HivePropertyKey.FIELDS_TERMINATED.getValue()); 16 | } 17 | 18 | @Override 19 | public String valueString() { 20 | return value; 21 | } 22 | 23 | @Override 24 | public void setValueString(String value) { 25 | this.value = value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hive/src/main/java/com/aliyun/fastmodel/transform/hive/client/property/LinesTerminated.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.hive.client.property; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 4 | import com.aliyun.fastmodel.transform.hive.format.HivePropertyKey; 5 | 6 | /** 7 | * LinesTerminated 8 | * 9 | * @author panguanjing 10 | * @date 2023/2/6 11 | */ 12 | public class LinesTerminated extends BaseClientProperty { 13 | 14 | public LinesTerminated() { 15 | this.setKey(HivePropertyKey.LINES_TERMINATED.getValue()); 16 | } 17 | 18 | @Override 19 | public String valueString() { 20 | return value; 21 | } 22 | 23 | @Override 24 | public void setValueString(String value) { 25 | this.value = value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hive/src/main/java/com/aliyun/fastmodel/transform/hive/format/HiveExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.hive.format; 10 | 11 | import com.aliyun.fastmodel.transform.api.format.DefaultExpressionVisitor; 12 | 13 | /** 14 | * HiveExpressionVisitor 15 | * 16 | * @author panguanjing 17 | * @date 2021/4/13 18 | */ 19 | public class HiveExpressionVisitor extends DefaultExpressionVisitor { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hive/src/test/java/com/aliyun/fastmodel/transform/hive/client/property/HivePropertyKeyTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.hive.client.property; 2 | 3 | import com.aliyun.fastmodel.transform.hive.format.HivePropertyKey; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertNotNull; 7 | import static org.junit.Assert.assertNull; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2023/2/7 14 | */ 15 | public class HivePropertyKeyTest { 16 | @Test 17 | public void testGetByValue() { 18 | HivePropertyKey byValue = HivePropertyKey.getByValue("hive.table_external"); 19 | assertNotNull(byValue); 20 | HivePropertyKey notExist = HivePropertyKey.getByValue("notExist"); 21 | assertNull(notExist); 22 | } 23 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hive/src/test/java/com/aliyun/fastmodel/transform/hive/parser/tree/datatype/HiveDataTypeNameTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.hive.parser.tree.datatype; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.junit.Assert.*; 14 | 15 | /** 16 | * HiveDataTypeNameTest 17 | * 18 | * @author panguanjing 19 | * @date 2022/8/8 20 | */ 21 | public class HiveDataTypeNameTest { 22 | 23 | @Test 24 | public void getByValue() { 25 | HiveDataTypeName string = HiveDataTypeName.getByValue("string"); 26 | assertEquals(string, HiveDataTypeName.STRING); 27 | } 28 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/java/com/aliyun/fastmodel/transform/hologres/client/generator/impl/BaseGeneratorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.hologres.client.generator.impl; 10 | 11 | import com.aliyun.fastmodel.transform.api.client.CodeGenerator; 12 | import com.aliyun.fastmodel.transform.api.client.generator.DefaultCodeGenerator; 13 | 14 | /** 15 | * Desc: 16 | * 17 | * @author panguanjing 18 | * @date 2022/6/16 19 | */ 20 | public abstract class BaseGeneratorTest { 21 | CodeGenerator codeGenerator = new DefaultCodeGenerator(); 22 | } 23 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/java/com/aliyun/fastmodel/transform/hologres/client/property/TimeToLiveSecondsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.hologres.client.property; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.junit.Assert.*; 14 | 15 | /** 16 | * Desc: 17 | * 18 | * @author panguanjing 19 | * @date 2022/6/16 20 | */ 21 | public class TimeToLiveSecondsTest { 22 | 23 | @Test 24 | public void testTimeToLiveSeconds() { 25 | TimeToLiveSeconds timeToLiveSeconds = new TimeToLiveSeconds(); 26 | timeToLiveSeconds.setValueString("1"); 27 | assertEquals(timeToLiveSeconds.getValue(), new Long(1L)); 28 | } 29 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/java/com/aliyun/fastmodel/transform/hologres/context/HologresTransformQueryContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022. Aliyun.com All right reserved. This software is the 3 | * confidential and proprietary information of Aliyun.com ("Confidential 4 | * Information"). You shall not disclose such Confidential Information and shall 5 | * use it only in accordance with the terms of the license agreement you entered 6 | * into with Aliyun.com. 7 | */ 8 | 9 | package com.aliyun.fastmodel.transform.hologres.context; 10 | 11 | /** 12 | * query context 13 | * 14 | * @author panguanjing 15 | * @date 2022/7/2 16 | */ 17 | public class HologresTransformQueryContext { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/java/com/aliyun/fastmodel/transform/hologres/parser/util/HologresReservedWordUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.hologres.parser.util; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertFalse; 6 | import static org.junit.Assert.assertTrue; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2023/1/27 13 | */ 14 | public class HologresReservedWordUtilTest { 15 | 16 | @Test 17 | public void isReservedKeyWord() { 18 | boolean array = HologresReservedWordUtil.isReservedKeyWord("array"); 19 | assertTrue(array); 20 | 21 | boolean abc = HologresReservedWordUtil.isReservedKeyWord("abc"); 22 | assertFalse(abc); 23 | } 24 | 25 | @Test 26 | public void testAge() { 27 | boolean r = HologresReservedWordUtil.isReservedKeyWord("age"); 28 | assertFalse(r); 29 | } 30 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/auto.txt: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE IF NOT EXISTS public.hologres_parent ( 3 | a TEXT, 4 | b INTEGER, 5 | c TIMESTAMP, 6 | d TEXT 7 | ) PARTITION BY LIST(a); 8 | CALL SET_TABLE_PROPERTY('public.hologres_parent', 'time_to_live_in_seconds', '3153600000'); 9 | CALL SET_TABLE_PROPERTY('public.hologres_parent', 'orientation', 'column'); 10 | CALL SET_TABLE_PROPERTY('public.hologres_parent', 'binlog.level', 'none'); 11 | CALL SET_TABLE_PROPERTY('public.hologres_parent', 'bitmap_columns', 'a,d'); 12 | CALL SET_TABLE_PROPERTY('public.hologres_parent', 'dictionary_encoding_columns', 'a:auto,d:auto'); 13 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/default_text.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.table_name11 ( 2 | c1 TEXT PRIMARY KEY DEFAULT '1'::TEXT, 3 | c2 TEXT DEFAULT '2'::TEXT, 4 | c3 TEXT DEFAULT '3'::TEXT, 5 | c4 INTEGER DEFAULT 1::int 6 | ) PARTITION BY LIST(c1); 7 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/alter/dynamic_no_column_after.txt: -------------------------------------------------------------------------------- 1 | CREATE DYNAMIC TABLE b.sales_incremental 2 | WITH (refresh_mode='streaming',auto_refresh_enable='true') 3 | AS 4 | SELECT day, sum(amount), count(1) 5 | FROM base_sales 6 | GROUP BY day; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/alter/dynamic_no_column_before.txt: -------------------------------------------------------------------------------- 1 | CREATE DYNAMIC TABLE b.sales_incremental 2 | WITH (refresh_mode='incremental') 3 | AS 4 | SELECT day, hour, sum(amount), count(1) 5 | FROM base_sales 6 | GROUP BY day, hour; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_no_column.txt: -------------------------------------------------------------------------------- 1 | CREATE DYNAMIC TABLE sales_incremental 2 | WITH (refresh_mode='incremental') 3 | AS 4 | SELECT day, hour, sum(amount), count(1) 5 | FROM base_sales 6 | GROUP BY day, hour; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_no_column.txt.result: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE DYNAMIC TABLE sales_incremental 3 | WITH ( 4 | refresh_mode='incremental' 5 | ) AS 6 | SELECT day, hour, sum(amount), count(1) 7 | FROM base_sales 8 | GROUP BY day, hour; 9 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_no_column2.txt: -------------------------------------------------------------------------------- 1 | CREATE DYNAMIC TABLE public.tpch_q1_incremental 2 | with ( 3 | refresh_mode='incremental', 4 | auto_refresh_enable='true', 5 | incremental_auto_refresh_schd_start_time='2024-09-15 23:50:0', 6 | incremental_auto_refresh_interval='3 minutes', 7 | incremental_guc_hg_computing_resource='serverless', 8 | incremental_guc_hg_experimental_serverless_computing_required_cores='30' 9 | ) AS select 10 | l_returnflag, 11 | l_linestatus, 12 | count(*) as count_order 13 | from 14 | hologres_dataset_tpch_100g.lineitem 15 | where 16 | l_shipdate <= date '1998-12-01' - interval '120' day 17 | group by 18 | l_returnflag, 19 | l_linestatus 20 | ; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_no_column2.txt.result: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE DYNAMIC TABLE tpch_q1_incremental 3 | WITH ( 4 | refresh_mode='incremental', 5 | auto_refresh_enable='true', 6 | incremental_auto_refresh_schd_start_time='2024-09-15 23:50:0', 7 | incremental_auto_refresh_interval='3 minutes', 8 | incremental_guc_hg_computing_resource='serverless', 9 | incremental_guc_hg_experimental_serverless_computing_required_cores='30' 10 | ) AS 11 | select 12 | l_returnflag, 13 | l_linestatus, 14 | count(*) as count_order 15 | from 16 | hologres_dataset_tpch_100g.lineitem 17 | where 18 | l_shipdate <= date '1998-12-01' - interval '120' day 19 | group by 20 | l_returnflag, 21 | l_linestatus; 22 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_table.txt: -------------------------------------------------------------------------------- 1 | CREATE DYNAMIC TABLE public.tpch_q1_incremental 2 | (a,b) 3 | PARTITION BY LIST (a) 4 | with ( 5 | refresh_mode='incremental', 6 | auto_refresh_enable='true', 7 | incremental_auto_refresh_schd_start_time='2024-09-15 23:50:0', 8 | incremental_auto_refresh_interval='3 minutes', 9 | incremental_guc_hg_computing_resource='serverless', 10 | incremental_guc_hg_experimental_serverless_computing_required_cores='30' 11 | ) AS select 12 | l_returnflag, 13 | l_linestatus, 14 | count(*) as count_order 15 | from 16 | hologres_dataset_tpch_100g.lineitem 17 | where 18 | l_shipdate <= date '1998-12-01' - interval '120' day 19 | group by 20 | l_returnflag, 21 | l_linestatus 22 | ; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/dynamic/dynamic_table.txt.result: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE DYNAMIC TABLE tpch_q1_incremental ( 3 | a, 4 | b 5 | ) PARTITION BY LIST(a) 6 | WITH ( 7 | refresh_mode='incremental', 8 | auto_refresh_enable='true', 9 | incremental_auto_refresh_schd_start_time='2024-09-15 23:50:0', 10 | incremental_auto_refresh_interval='3 minutes', 11 | incremental_guc_hg_computing_resource='serverless', 12 | incremental_guc_hg_experimental_serverless_computing_required_cores='30' 13 | ) AS 14 | select 15 | l_returnflag, 16 | l_linestatus, 17 | count(*) as count_order 18 | from 19 | hologres_dataset_tpch_100g.lineitem 20 | where 21 | l_shipdate <= date '1998-12-01' - interval '120' day 22 | group by 23 | l_returnflag, 24 | l_linestatus; 25 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/keyword.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl 2 | ( 3 | id BIGINT NOT NULL 4 | ,name TEXT NOT NULL 5 | ,age BIGINT NOT NULL 6 | ,class TEXT NOT NULL 7 | ,reg_timestamp TIMESTAMP WITH TIME ZONE NOT NULL 8 | ,PRIMARY KEY (id,age) 9 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/npe.txt: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE IF NOT EXISTS public.cx_1220_tbl1_1 ( 3 | id BIGINT, 4 | "name" TEXT, 5 | birthday TIMESTAMP WITH TIME ZONE, 6 | salary DECIMAL(38,10), 7 | pt int, 8 | PRIMARY KEY (id,pt) 9 | ) 10 | PARTITION BY LIST (pt) ; 11 | CALL set_table_property('public.cx_1220_tbl1_1', 'orientation', 'column'); 12 | CREATE TABLE public.cx_1220_tbl1_11 PARTITION OF public.cx_1220_tbl1_1 FOR VALUES IN (2021); 13 | CREATE TABLE public.cx_1220_tbl1_12 PARTITION OF public.cx_1220_tbl1_1 FOR VALUES IN (2022); 14 | CREATE TABLE public.cx_1220_tbl1_13 PARTITION OF public.cx_1220_tbl1_1 FOR VALUES IN (2023); 15 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/primary.txt: -------------------------------------------------------------------------------- 1 | create table holo_test ( 2 | id int, 3 | name text, 4 | primary key (id) 5 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/rename.txt: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE public.test_2 ( 3 | c1 text NOT NULL, 4 | c2 text, 5 | c3 text, 6 | c4 text 7 | ,PRIMARY KEY (c1) 8 | ); 9 | CALL set_table_property('public.test_2', 'dictionary_encoding_columns', 'c1:auto,c3,c2'); 10 | END; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/rename2.txt: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE public.test_2 ( 3 | c1 TEXT NOT NULL, 4 | c2 TEXT, 5 | c3 TEXT, 6 | c4 TEXT, 7 | PRIMARY KEY(c1) 8 | ); 9 | CALL SET_TABLE_PROPERTY('public.test_2', 'dictionary_encoding_columns', '"c1":auto,"c3":on,"c2":on'); 10 | COMMIT; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-hologres/src/test/resources/hologres/reverse_default_value.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.user_info ( 2 | id integer NOT NULL default nextval('user_info_id_seq'::regclass), 3 | username character varying(50) NOT NULL, password character varying(50) NOT NULL, 4 | email character varying(100) NOT NULL, 5 | created_at timestamp with time zone NOT NULL default CURRENT_TIMESTAMP , 6 | PRIMARY KEY (id) 7 | ) 8 | with ( 9 | orientation = 'column',storage_format = 'orc', 10 | bitmap_columns = 'username,password,email', 11 | dictionary_encoding_columns = 'username:auto,password:auto,email:auto', 12 | distribution_key = 'id',segment_key = 'created_at', 13 | table_group = 'holo_db_tg_default', 14 | table_storage_mode = 'any', 15 | time_to_live_in_seconds = '3153600000' 16 | ); 17 | COMMENT ON TABLE public.user_info IS NULL; 18 | ALTER TABLE public.user_info OWNER TO holo_db_developer; 19 | END; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/dto/hash/HashPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.dto.hash; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * HashPartitionClient 12 | * 13 | * @author panguanjing 14 | * @date 2024/2/22 15 | */ 16 | @Data 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class HashPartitionClient { 21 | 22 | private Long partitionCount; 23 | 24 | private String expression; 25 | 26 | private SubHashPartitionClient subHashPartitionClient; 27 | 28 | private List partitionElementClientList; 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/dto/hash/HashPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.dto.hash; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.StringProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * Desc: 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class HashPartitionElementClient { 22 | private String qualifiedName; 23 | 24 | private Long num; 25 | 26 | private StringProperty property; 27 | 28 | private List subPartitionList; 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/dto/hash/SubHashPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.dto.hash; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/22 13 | */ 14 | @Data 15 | @Builder 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class SubHashPartitionClient { 19 | private String expression; 20 | private Long subpartitionCount; 21 | } 22 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/dto/hash/SubHashPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.dto.hash; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.StringProperty; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2024/2/22 14 | */ 15 | @Data 16 | @Builder 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | public class SubHashPartitionElementClient { 20 | /** 21 | * name 22 | */ 23 | private String qualifiedName; 24 | 25 | /** 26 | * engine 27 | */ 28 | private StringProperty stringProperty; 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/SubPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property; 2 | 3 | /** 4 | * abstract sub partition client 5 | * 6 | * @author panguanjing 7 | * @date 2024/2/25 8 | */ 9 | public abstract class SubPartitionClient { 10 | } 11 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/SubPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property; 2 | 3 | /** 4 | * PartitionElementClient 5 | * 6 | * @author panguanjing 7 | * @date 2024/2/28 8 | */ 9 | public abstract class SubPartitionElementClient { 10 | } 11 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/HashPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * HashPartitionClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class HashPartitionClient { 22 | 23 | private Long partitionCount; 24 | 25 | private String expression; 26 | 27 | private SubPartitionClient subPartitionClient; 28 | 29 | private List partitionElementClientList; 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/HashPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.StringProperty; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * Desc: 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class HashPartitionElementClient { 22 | private String qualifiedName; 23 | 24 | private Long num; 25 | 26 | private StringProperty property; 27 | 28 | private List subPartitionList; 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/HashPartitionProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 6 | import com.aliyun.fastmodel.transform.oceanbase.format.OceanBasePropertyKey; 7 | 8 | /** 9 | * hash partition property 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/22 13 | */ 14 | public class HashPartitionProperty extends BaseClientProperty { 15 | 16 | public HashPartitionProperty() { 17 | setKey(OceanBasePropertyKey.PARTITION.getValue()); 18 | } 19 | 20 | @Override 21 | public String valueString() { 22 | return JSON.toJSONString(value); 23 | } 24 | 25 | @Override 26 | public void setValueString(String value) { 27 | this.setValue(JSON.parseObject(value, HashPartitionClient.class)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/SubHashPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2024/2/22 14 | */ 15 | @Data 16 | @Builder 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | public class SubHashPartitionClient extends SubPartitionClient { 20 | private String expression; 21 | private Long subpartitionCount; 22 | } 23 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/SubHashPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import com.aliyun.fastmodel.transform.api.client.dto.property.StringProperty; 4 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * Desc: 12 | * 13 | * @author panguanjing 14 | * @date 2024/2/22 15 | */ 16 | @Data 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class SubHashPartitionElementClient extends SubPartitionElementClient { 21 | /** 22 | * name 23 | */ 24 | private String qualifiedName; 25 | 26 | /** 27 | * engine 28 | */ 29 | private StringProperty stringProperty; 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/hash/SubHashTemplatePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.hash; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | 12 | /** 13 | * Desc: 14 | * 15 | * @author panguanjing 16 | * @date 2024/2/28 17 | */ 18 | @Data 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | @Builder 22 | public class SubHashTemplatePartitionClient extends SubPartitionClient { 23 | 24 | private String expression; 25 | 26 | private List subPartitionElementClientList; 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/key/KeyPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.key; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import com.aliyun.fastmodel.transform.oceanbase.client.property.hash.HashPartitionElementClient; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | 12 | /** 13 | * KeyPartitionClient 14 | * 15 | * @author panguanjing 16 | * @date 2024/2/26 17 | */ 18 | @Data 19 | @Builder 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class KeyPartitionClient { 23 | 24 | private Long partitionCount; 25 | 26 | private List columnList; 27 | 28 | private SubPartitionClient subPartitionClient; 29 | 30 | private List partitionElementClientList; 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/key/KeyPartitionProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.key; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 6 | import com.aliyun.fastmodel.transform.oceanbase.format.OceanBasePropertyKey; 7 | 8 | /** 9 | * KeyPartitionProperty 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/22 13 | */ 14 | public class KeyPartitionProperty extends BaseClientProperty { 15 | 16 | public KeyPartitionProperty() { 17 | setKey(OceanBasePropertyKey.PARTITION.getValue()); 18 | } 19 | 20 | @Override 21 | public String valueString() { 22 | return JSON.toJSONString(value); 23 | } 24 | 25 | @Override 26 | public void setValueString(String value) { 27 | this.setValue(JSON.parseObject(value, KeyPartitionClient.class)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/key/SubKeyPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.key; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * key partition client 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class SubKeyPartitionClient extends SubPartitionClient { 22 | private Long subPartitionCount; 23 | 24 | private List columnList; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/key/SubKeyTemplatePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.key; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | 12 | /** 13 | * SubKeyTemplatePartitionClient 14 | * 15 | * @author panguanjing 16 | * @date 2024/2/28 17 | */ 18 | @Data 19 | @Builder 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class SubKeyTemplatePartitionClient extends SubPartitionClient { 23 | 24 | private List columnList; 25 | 26 | private List subPartitionElementClients; 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/ListPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * ListPartitionClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/23 16 | */ 17 | @Data 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | @Builder 21 | public class ListPartitionClient { 22 | private String expression; 23 | 24 | private List columns; 25 | 26 | private Long partitionCount; 27 | 28 | private SubPartitionClient subPartitionClient; 29 | 30 | private List partitionElementClientList; 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/ListPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * ListPartitionElementClient 12 | * 13 | * @author panguanjing 14 | * @date 2024/2/26 15 | */ 16 | @Data 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | @Builder 20 | public class ListPartitionElementClient { 21 | private String qualifiedName; 22 | 23 | private Boolean defaultExpr; 24 | 25 | private List expressionList; 26 | 27 | private Long num; 28 | 29 | private String engine; 30 | 31 | private List subPartitionElementList; 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/ListPartitionProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 6 | import com.aliyun.fastmodel.transform.oceanbase.format.OceanBasePropertyKey; 7 | 8 | /** 9 | * list partition property 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/26 13 | */ 14 | public class ListPartitionProperty extends BaseClientProperty { 15 | 16 | public ListPartitionProperty() { 17 | setKey(OceanBasePropertyKey.PARTITION.getValue()); 18 | } 19 | 20 | @Override 21 | public String valueString() { 22 | return JSON.toJSONString(value); 23 | } 24 | 25 | @Override 26 | public void setValueString(String value) { 27 | this.setValue(JSON.parseObject(value, ListPartitionClient.class)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/ListSubPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * ListSubPartitionElementClient 12 | * 13 | * @author panguanjing 14 | * @date 2024/2/26 15 | */ 16 | @Data 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class ListSubPartitionElementClient { 21 | private String qualifiedName; 22 | 23 | private Boolean defaultListExpr; 24 | 25 | private List expressionList; 26 | 27 | private String engine; 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/SubListPartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * SubListPartitionClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/26 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class SubListPartitionClient extends SubPartitionClient { 22 | 23 | private String expression; 24 | 25 | private List columnList; 26 | } 27 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/SubListPartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * ListSubPartitionElementClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/26 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class SubListPartitionElementClient extends SubPartitionElementClient { 22 | private String qualifiedName; 23 | 24 | private Boolean defaultListExpr; 25 | 26 | private List expressionList; 27 | 28 | private String engine; 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/list/SubListTemplatePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.list; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | 12 | /** 13 | * Desc: 14 | * 15 | * @author panguanjing 16 | * @date 2024/2/18 17 | */ 18 | @Data 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | @Builder 22 | public class SubListTemplatePartitionClient extends SubPartitionClient { 23 | 24 | private String expression; 25 | 26 | private List columnList; 27 | 28 | private List subPartitionElementClientList; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/RangePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * Desc: 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class RangePartitionClient { 22 | 23 | private List columns; 24 | 25 | private Long partitionCount; 26 | 27 | private String baseExpression; 28 | 29 | private List rangePartitionElementClients; 30 | 31 | private SubPartitionClient rangeSubPartitionClient; 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/RangePartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1.SingleRangeClientPartition; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * RangePartitionElementClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class RangePartitionElementClient { 22 | 23 | private Long id; 24 | 25 | private SingleRangeClientPartition singleRangeClientPartition; 26 | 27 | private List rangeSubPartitionElementClients; 28 | } 29 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/RangePartitionProperty.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | import com.aliyun.fastmodel.transform.api.client.dto.property.BaseClientProperty; 6 | import com.aliyun.fastmodel.transform.oceanbase.format.OceanBasePropertyKey; 7 | 8 | /** 9 | * RangePartitionProperty 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/22 13 | */ 14 | public class RangePartitionProperty extends BaseClientProperty { 15 | 16 | public RangePartitionProperty() { 17 | setKey(OceanBasePropertyKey.PARTITION.getValue()); 18 | } 19 | 20 | @Override 21 | public String valueString() { 22 | return JSON.toJSONString(value); 23 | } 24 | 25 | @Override 26 | public void setValueString(String value) { 27 | this.value = JSON.parseObject(value, RangePartitionClient.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/SubRangePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | /** 12 | * RangeSubPartitionClient 13 | * 14 | * @author panguanjing 15 | * @date 2024/2/22 16 | */ 17 | @Data 18 | @Builder 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | public class SubRangePartitionClient extends SubPartitionClient { 22 | private String expression; 23 | 24 | private List columnList; 25 | 26 | private List singleRangePartitionList; 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/SubRangePartitionElementClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import com.aliyun.fastmodel.transform.api.extension.client.property.table.partition.v1.SingleRangeClientPartition; 4 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * range sub partition element client 12 | * 13 | * @author panguanjing 14 | * @date 2024/2/22 15 | */ 16 | @Data 17 | @Builder 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class SubRangePartitionElementClient extends SubPartitionElementClient { 21 | private SingleRangeClientPartition singleRangeClientPartition; 22 | } 23 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/client/property/range/SubRangeTemplatePartitionClient.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.property.range; 2 | 3 | import java.util.List; 4 | 5 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionClient; 6 | import com.aliyun.fastmodel.transform.oceanbase.client.property.SubPartitionElementClient; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | 12 | /** 13 | * SubRangeTemplatePartition 14 | * 15 | * @author panguanjing 16 | * @date 2024/2/18 17 | */ 18 | @Data 19 | @Builder 20 | @NoArgsConstructor 21 | @AllArgsConstructor 22 | public class SubRangeTemplatePartitionClient extends SubPartitionClient { 23 | 24 | private String expression; 25 | 26 | private List columnList; 27 | 28 | private List subPartitionElementClientList; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/context/OceanBaseContext.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.context; 2 | 3 | import com.aliyun.fastmodel.transform.api.context.TransformContext; 4 | 5 | /** 6 | * OceanBaseContext 7 | * 8 | * @author panguanjing 9 | * @date 2024/2/2 10 | */ 11 | public class OceanBaseContext extends TransformContext { 12 | public OceanBaseContext(TransformContext context) { 13 | super(context); 14 | } 15 | 16 | public OceanBaseContext(Builder tBuilder) { 17 | super(tBuilder); 18 | } 19 | 20 | public static Builder builder() { 21 | return new Builder(); 22 | } 23 | 24 | public static class Builder extends TransformContext.Builder { 25 | 26 | @Override 27 | public OceanBaseContext build() { 28 | return new OceanBaseContext(this); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/parser/tree/partition/desc/BaseSubPartition.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.parser.tree.partition.desc; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractNode; 4 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 5 | import com.aliyun.fastmodel.transform.oceanbase.parser.visitor.OceanBaseMysqlAstVisitor; 6 | 7 | /** 8 | * sub partition 9 | * 10 | * @author panguanjing 11 | * @date 2024/2/2 12 | */ 13 | public abstract class BaseSubPartition extends AbstractNode { 14 | 15 | @Override 16 | public R accept(IAstVisitor visitor, C context) { 17 | OceanBaseMysqlAstVisitor extensionAstVisitor = (OceanBaseMysqlAstVisitor)visitor; 18 | return extensionAstVisitor.visitBaseSubPartition(this, context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/parser/tree/partition/desc/element/PartitionElement.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.parser.tree.partition.desc.element; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractNode; 4 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 5 | import com.aliyun.fastmodel.transform.oceanbase.parser.visitor.OceanBaseMysqlAstVisitor; 6 | 7 | /** 8 | * partition elements 9 | * 10 | * @author panguanjing 11 | * @date 2024/2/7 12 | */ 13 | public abstract class PartitionElement extends AbstractNode { 14 | @Override 15 | public R accept(IAstVisitor visitor, C context) { 16 | OceanBaseMysqlAstVisitor astVisitor = (OceanBaseMysqlAstVisitor)visitor; 17 | return astVisitor.visitPartitionElement(this, context); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/main/java/com/aliyun/fastmodel/transform/oceanbase/parser/tree/partition/desc/element/SubPartitionElement.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.parser.tree.partition.desc.element; 2 | 3 | import com.aliyun.fastmodel.core.tree.AbstractNode; 4 | import com.aliyun.fastmodel.core.tree.IAstVisitor; 5 | import com.aliyun.fastmodel.transform.oceanbase.parser.visitor.OceanBaseMysqlAstVisitor; 6 | 7 | /** 8 | * Desc: 9 | * 10 | * @author panguanjing 11 | * @date 2024/2/7 12 | */ 13 | public abstract class SubPartitionElement extends AbstractNode { 14 | 15 | @Override 16 | public R accept(IAstVisitor visitor, C context) { 17 | OceanBaseMysqlAstVisitor astVisitor = (OceanBaseMysqlAstVisitor)visitor; 18 | return astVisitor.visitSubPartitionElement(this, context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/java/com/aliyun/fastmodel/transform/oceanbase/BaseOceanbaseTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase; 2 | 3 | import java.nio.charset.Charset; 4 | 5 | import lombok.SneakyThrows; 6 | import org.apache.commons.io.IOUtils; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2024/2/7 13 | */ 14 | public abstract class BaseOceanbaseTest { 15 | @SneakyThrows 16 | public String getText(String name) { 17 | return IOUtils.resourceToString("/oceanbase/" + name, Charset.defaultCharset()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/java/com/aliyun/fastmodel/transform/oceanbase/client/converter/partition/impl/OceanBasePartitionClientConverterImplTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.client.converter.partition.impl; 2 | 3 | import com.aliyun.fastmodel.transform.oceanbase.client.converter.OceanBaseMysqlClientConverter; 4 | import org.junit.Test; 5 | 6 | /** 7 | * OceanBasePartitionClientConverterImplTest 8 | * 9 | * @author panguanjing 10 | * @date 2024/2/28 11 | */ 12 | public class OceanBasePartitionClientConverterImplTest { 13 | 14 | private OceanBaseMysqlClientConverter baseMysqlClientConverter = new OceanBaseMysqlClientConverter(); 15 | 16 | @Test 17 | public void toSubPartitionClient() { 18 | 19 | } 20 | 21 | @Test 22 | public void getSubPartition() { 23 | } 24 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/java/com/aliyun/fastmodel/transform/oceanbase/parser/tree/OceanBaseMysqlDataTypeNameTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.oceanbase.parser.tree; 2 | 3 | import com.aliyun.fastmodel.core.tree.datatype.IDataTypeName; 4 | import com.aliyun.fastmodel.core.tree.datatype.IDataTypeName.Dimension; 5 | import org.junit.Test; 6 | 7 | import static org.junit.Assert.assertEquals; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2024/2/19 14 | */ 15 | public class OceanBaseMysqlDataTypeNameTest { 16 | @Test 17 | public void testDataTypeName() { 18 | IDataTypeName varchar = OceanBaseMysqlDataTypeName.getByValue("varchar"); 19 | assertEquals(Dimension.ONE, varchar.getDimension()); 20 | } 21 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/range_error.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE employees1 ( 2 | id INT NOT NULL, 3 | first_name VARCHAR(30), 4 | last_name VARCHAR(30), 5 | hired_date DATE NOT NULL, 6 | salary INT NOT NULL, 7 | PRIMARY KEY (id, hired_date) 8 | ) ENGINE=InnoDB 9 | PARTITION BY RANGE (YEAR(hired_date)) ( 10 | PARTITION p0 VALUES LESS THAN (1991), 11 | PARTITION p1 VALUES LESS THAN (1996), 12 | PARTITION p2 VALUES LESS THAN (2001), 13 | PARTITION p3 VALUES LESS THAN (2006), 14 | PARTITION p4 VALUES LESS THAN (2011), 15 | PARTITION p5 VALUES LESS THAN (2016), 16 | PARTITION p6 VALUES LESS THAN (2021), 17 | PARTITION p7 VALUES LESS THAN MAXVALUE 18 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple1.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl1 (c1 bigint unsigned zerofill not null, c2 VARCHAR(50), primary key (c1)); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple10_timestamp.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `autotest_db_mysqlreader_1062102` ( 2 | `field_timestamp` timestamp NULL DEFAULT NULL 3 | ) 4 | DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMPRESSION = 'zstd_1.3.8' 5 | REPLICA_NUM = 3 BLOCK_SIZE = 16384 6 | USE_BLOOM_FILTER = FALSE 7 | TABLET_SIZE = 134217728 8 | PCTFREE = 0 9 | PROGRESSIVE_MERGE_NUM = 10 10 | MAX_USED_PART_ID = 1; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple1_comment.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl1 (c1 INT PRIMARY KEY, c2 VARCHAR(50)) COMMENT 'comment' PARTITION BY KEY (c1) PARTITIONS 8; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple2_index.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl2 (c1 INT PRIMARY KEY, c2 INT, c3 INT, INDEX i1 (c2)); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple2_index2.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl3 (c1 INT, c2 INT, INDEX i1 ((c1+1)), UNIQUE KEY ((c1+c2))); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple3_hash.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl4 (c1 INT PRIMARY KEY, c2 INT) PARTITION BY HASH(c1) PARTITIONS 8; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple3_range.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl5 (c1 INT, c2 INT, c3 INT) PARTITION BY RANGE(c1) 2 | SUBPARTITION BY KEY(c2, c3) SUBPARTITIONS 5 3 | (PARTITION p0 VALUES LESS THAN(0), PARTITION p1 VALUES LESS THAN(100)); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple4_charset.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl6 (c1 VARCHAR(10), 2 | c2 VARCHAR(10) CHARSET GBK COLLATE gbk_bin) 3 | DEFAULT CHARSET utf8 COLLATE utf8mb4_general_ci; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple5_compress.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl7 (c1 INT, c2 INT, c3 VARCHAR(64)) 2 | COMPRESSION 'zstd_1.0' 3 | ROW_FORMAT DYNAMIC 4 | PCTFREE 5; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple6_pr.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl8(c1 INT PRIMARY KEY, c2 INT) PARALLEL 3; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple7_autoincrement.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl9(inv_id BIGINT NOT NULL AUTO_INCREMENT,c1 BIGINT, 2 | PRIMARY KEY (inv_id) ) PARTITION BY HASH(inv_id) PARTITIONS 8; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple8_check.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl10 (col1 INT, col2 INT, col3 INT, CONSTRAINT equal_check1 CHECK(col1 = col3 * 2)); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple8_reference.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE ref_t2(c1 INT PRIMARY KEY, C2 INT,FOREIGN KEY(c2) REFERENCES ref_t1(c1) ON UPDATE SET NULL); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_combine_1.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tb1_m_rcr(col1 INT,col2 INT) 2 | PARTITION BY RANGE COLUMNS(col1) 3 | SUBPARTITION BY RANGE(col2) 4 | SUBPARTITION TEMPLATE 5 | (SUBPARTITION mp0 VALUES LESS THAN(3), 6 | SUBPARTITION mp1 VALUES LESS THAN(6), 7 | SUBPARTITION mp2 VALUES LESS THAN(9) 8 | ) 9 | (PARTITION p0 VALUES LESS THAN(100), 10 | PARTITION p1 VALUES LESS THAN(200), 11 | PARTITION p2 VALUES LESS THAN(300) 12 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_combine_2.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl2_f_llc(col1 INT,col2 DATE) 2 | PARTITION BY LIST(col1) 3 | SUBPARTITION BY LIST COLUMNS(col2) 4 | (PARTITION p0 VALUES IN(100) 5 | (SUBPARTITION sp0 VALUES IN('2021/04/01'), 6 | SUBPARTITION sp1 VALUES IN('2021/07/01'), 7 | SUBPARTITION sp2 VALUES IN('2021/10/01'), 8 | SUBPARTITION sp3 VALUES IN('2022/01/01') 9 | ), 10 | PARTITION p1 VALUES IN(200) 11 | (SUBPARTITION sp4 VALUES IN('2021/04/01'), 12 | SUBPARTITION sp5 VALUES IN('2021/07/01'), 13 | SUBPARTITION sp6 VALUES IN('2021/10/01'), 14 | SUBPARTITION sp7 VALUES IN('2022/01/01') 15 | ) 16 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_combine_3.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl3_f_hk (col1 INT,col2 VARCHAR(50)) 2 | PARTITION BY HASH(col1) 3 | SUBPARTITION BY KEY(col2) 4 | (PARTITION p1 5 | (SUBPARTITION sp0 6 | ,SUBPARTITION sp1 7 | ,SUBPARTITION sp2 8 | ,SUBPARTITION sp3 9 | ), 10 | PARTITION p2 11 | (SUBPARTITION sp4 12 | ,SUBPARTITION sp5 13 | ,SUBPARTITION sp6 14 | ,SUBPARTITION sp7 15 | ) 16 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_hash.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl3_h(col1 INT,col2 VARCHAR(50)) 2 | PARTITION BY HASH(col1) PARTITIONS 2; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_key.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tb1_rc(col1 INT,col2 INT) 2 | PARTITION BY KEY (col1,col2) PARTITIONS 8 3 | ; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_list.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tbl2_l (col1 INT,col2 DATE) 2 | PARTITION BY LIST(col1) 3 | (PARTITION p0 VALUES IN (100), 4 | PARTITION p1 VALUES IN (200) 5 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-oceanbase/src/test/resources/oceanbase/simple9_pt_range.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE tb1_rc(col1 INT,col2 INT) 2 | PARTITION BY RANGE COLUMNS(col1) 3 | (PARTITION p0 VALUES LESS THAN(100), 4 | PARTITION p1 VALUES LESS THAN(200), 5 | PARTITION p2 VALUES LESS THAN(300) 6 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/main/resources/fragment/indicator.ftl: -------------------------------------------------------------------------------- 1 | entity ${indicatorName} <<(I , #FF7700) <#if comment??>{comment}$>> { 2 | <#if expr??> 3 | ${expr} : ${dataType} 4 | 5 | } 6 | 7 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/main/resources/fragment/refRelation.ftl: -------------------------------------------------------------------------------- 1 | <#list constraints as constraint> 2 | ${constraint.left.table}<#if (constraint.left.column)??>::${constraint.left.column}<#if (constraint.leftComment)??> "${constraint.leftComment}" ${constraint.direction}<#if (constraint.rightComment)??> "${constraint.rightComment}" ${constraint.right.table}<#if (constraint.right.column)??>::${constraint.right.column} <#if (constraint.constraintName)??>:${constraint.constraintName} 3 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/main/resources/fragment/table.ftl: -------------------------------------------------------------------------------- 1 | Table(${tableCode}<#if comment??>,${comment}) { 2 | <#if cols??> 3 | <#list cols as col> 4 | Column(<#if col.primaryKey??>PK("${col.colName}")<#else>"${col.colName}", "${col.colType}", <#if col.notNull??>1<#else>0,"", <#if col.colAlias??>"${col.colAlias}"<#else>"", <#if col.colComment??>"${col.colComment}"<#else>"") 5 | 6 | 7 | } 8 | <#if constraints??> 9 | <#list constraints as constraint> 10 | ${constraint.left.table} --> ${constraint.right.table} 11 | 12 | 13 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/test/resources/importtest.txt: -------------------------------------------------------------------------------- 1 | import model.test_bu.dim_shop as shop; 2 | import model.test_bu.dim_shop_1 as shop1; 3 | 4 | shop -> shop1; -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/test/resources/plantuml/entity.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | entity users { 3 | id: Integer 4 | created_at: Timestamp 5 | } 6 | 7 | entity user_settings { 8 | user_id: Integer 9 | setting_key: String 10 | setting_value: String 11 | } 12 | user_settings::user_id -- users::id 13 | @enduml -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-plantuml/src/test/resources/plantuml/relation.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | 'https://plantuml.com/class-diagram 3 | t "comment" -> "comment" t1: abc 4 | @enduml -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-postgresql/src/main/java/com/aliyun/fastmodel/transform/postgresql/parser/PostgreSQLAstBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.postgresql.parser; 2 | 3 | import com.aliyun.fastmodel.core.tree.Node; 4 | import com.aliyun.fastmodel.transform.api.context.ReverseContext; 5 | 6 | /** 7 | * Desc: 8 | * 9 | * @author panguanjing 10 | * @date 2024/10/13 11 | */ 12 | public class PostgreSQLAstBuilder extends PostgreSQLParserBaseVisitor { 13 | private final ReverseContext reverseContext; 14 | 15 | public PostgreSQLAstBuilder(ReverseContext context) { 16 | this.reverseContext = context; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-postgresql/src/main/java/com/aliyun/fastmodel/transform/postgresql/parser/PostgreSQLParseError.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.postgresql.parser; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * PostgreSQLLexerBase 7 | * 8 | * @author panguanjing 9 | */ 10 | @Getter 11 | public class PostgreSQLParseError { 12 | 13 | private final int number; 14 | private final int offset; 15 | private final int line; 16 | private final int column; 17 | private final String Message; 18 | 19 | public PostgreSQLParseError(int number, int offset, int line, int column, String message) { 20 | this.number = number; 21 | this.offset = offset; 22 | Message = message; 23 | this.line = line; 24 | this.column = column; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-postgresql/src/main/java/com/aliyun/fastmodel/transform/postgresql/parser/PostgreSQLParserErrorListener.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.postgresql.parser; 2 | 3 | import org.antlr.v4.runtime.BaseErrorListener; 4 | import org.antlr.v4.runtime.RecognitionException; 5 | import org.antlr.v4.runtime.Recognizer; 6 | 7 | /** 8 | * error listener 9 | * 10 | * @author panguanjing 11 | */ 12 | public class PostgreSQLParserErrorListener extends BaseErrorListener { 13 | PostgreSQLParser grammar; 14 | 15 | public PostgreSQLParserErrorListener() { 16 | } 17 | 18 | @Override 19 | public void syntaxError(final Recognizer recognizer, final Object offendingSymbol, final int line, 20 | final int charPositionInLine, final String msg, final RecognitionException e) { 21 | grammar.ParseErrors.add(new PostgreSQLParseError(0, 0, line, charPositionInLine, msg)); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-postgresql/src/main/java/com/aliyun/fastmodel/transform/postgresql/parser/util/PostgreSQLReservedWordUtil.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.postgresql.parser.util; 2 | 3 | /** 4 | * PostgreSQLReservedWordUtil 5 | * 6 | * @author panguanjing 7 | * @date 2024/10/16 8 | */ 9 | public class PostgreSQLReservedWordUtil { 10 | 11 | public static boolean isReservedKeyWord(String word) { 12 | return false; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-spark/src/main/java/com/aliyun/fastmodel/transform/spark/context/SparkTableFormat.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.spark.context; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * table format 7 | * 8 | * @author panguanjing 9 | * @date 2023/2/18 10 | */ 11 | public enum SparkTableFormat { 12 | /** 13 | * https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-datasource.html 14 | */ 15 | DATASOURCE_FORMAT("dataSourceFormat"), 16 | 17 | /** 18 | * https://spark.apache.org/docs/latest/sql-ref-syntax-ddl-create-table-hiveformat.html 19 | */ 20 | HIVE_FORMAT("hiveFormat"); 21 | 22 | @Getter 23 | private final String value; 24 | 25 | SparkTableFormat(String value) { 26 | this.value = value; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-spark/src/test/java/com/aliyun/fastmodel/transform/spark/context/SparkTransformContextTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.spark.context; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * Desc: 9 | * 10 | * @author panguanjing 11 | * @date 2023/2/18 12 | */ 13 | public class SparkTransformContextTest { 14 | 15 | @Test 16 | public void testContext() { 17 | SparkTransformContext build = SparkTransformContext.builder().build(); 18 | assertEquals(build.getSparkTableFormat(), SparkTableFormat.HIVE_FORMAT); 19 | SparkTransformContext build1 = SparkTransformContext.builder().tableFormat(SparkTableFormat.DATASOURCE_FORMAT).build(); 20 | assertEquals(build1.getSparkTableFormat(), SparkTableFormat.DATASOURCE_FORMAT); 21 | } 22 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-spark/src/test/java/com/aliyun/fastmodel/transform/spark/format/SparkPropertyKeyTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.spark.format; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | import static org.junit.Assert.assertNull; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2023/2/18 13 | */ 14 | public class SparkPropertyKeyTest { 15 | 16 | @Test 17 | public void testGetByValue() { 18 | SparkPropertyKey sortedBy = SparkPropertyKey.getByValue("sorted_by"); 19 | assertEquals(sortedBy, SparkPropertyKey.SORTED_BY); 20 | sortedBy = SparkPropertyKey.getByValue("not_exist"); 21 | assertNull(sortedBy); 22 | } 23 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-spark/src/test/java/com/aliyun/fastmodel/transform/spark/parser/SparkLanguageParserTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.spark.parser; 2 | 3 | import com.aliyun.fastmodel.core.tree.Node; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | import static org.junit.Assert.assertNotNull; 8 | 9 | /** 10 | * Desc: 11 | * 12 | * @author panguanjing 13 | * @date 2023/2/23 14 | */ 15 | public class SparkLanguageParserTest { 16 | 17 | @Test 18 | public void parseNode() { 19 | String parseNode = "create table a (a bigint) comment 'abc'"; 20 | SparkLanguageParser sparkLanguageParser = new SparkLanguageParser(); 21 | Node o = sparkLanguageParser.parseNode(parseNode); 22 | assertNotNull(o); 23 | assertEquals(o.toString(), "CREATE TABLE a \n" 24 | + "(\n" 25 | + " a BIGINT\n" 26 | + ")\n" 27 | + "COMMENT 'abc'"); 28 | } 29 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-sqlite/src/main/java/com/aliyun/fastmodel/transform/sqlite/context/SqliteContext.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.sqlite.context; 2 | 3 | import com.aliyun.fastmodel.transform.api.context.TransformContext; 4 | 5 | /** 6 | * SqliteContext 7 | * 8 | * @author panguanjing 9 | * @date 2023/8/14 10 | */ 11 | public class SqliteContext extends TransformContext { 12 | public SqliteContext(TransformContext context) { 13 | super(context); 14 | } 15 | 16 | public SqliteContext(Builder builder) { 17 | super(builder); 18 | } 19 | 20 | public static Builder builder() { 21 | return new Builder(); 22 | } 23 | 24 | public static class Builder extends TransformContext.Builder { 25 | 26 | @Override 27 | public SqliteContext build() { 28 | return new SqliteContext(this); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-sqlite/src/main/java/com/aliyun/fastmodel/transform/sqlite/format/SqliteExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.sqlite.format; 2 | 3 | import com.aliyun.fastmodel.common.utils.StripUtils; 4 | import com.aliyun.fastmodel.core.formatter.ExpressionVisitor; 5 | import com.aliyun.fastmodel.core.tree.expr.Identifier; 6 | import org.apache.commons.lang3.StringUtils; 7 | 8 | /** 9 | * sqlite expression visitor 10 | * 11 | * @author panguanjing 12 | * @date 2023/8/29 13 | */ 14 | public class SqliteExpressionVisitor extends ExpressionVisitor { 15 | 16 | @Override 17 | public String visitIdentifier(Identifier node, Void context) { 18 | String value = StringUtils.isNotBlank(node.getOrigin()) ? 19 | StripUtils.strip(node.getOrigin()) : node.getValue(); 20 | if (!node.isDelimited()) { 21 | return value; 22 | } else { 23 | String strip = StripUtils.strip(value); 24 | return StripUtils.addDoubleStrip(strip); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/main/java/com/aliyun/fastmodel/transform/starrocks/context/StarRocksContext.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.starrocks.context; 2 | 3 | import com.aliyun.fastmodel.transform.api.context.TransformContext; 4 | 5 | /** 6 | * StarRocksContext 7 | * 8 | * @author panguanjing 9 | * @date 2023/9/5 10 | */ 11 | public class StarRocksContext extends TransformContext { 12 | public StarRocksContext(TransformContext context) { 13 | super(context); 14 | } 15 | 16 | public StarRocksContext(Builder tBuilder) { 17 | super(tBuilder); 18 | } 19 | 20 | public static Builder builder() { 21 | return new Builder(); 22 | } 23 | 24 | public static class Builder extends TransformContext.Builder { 25 | 26 | @Override 27 | public StarRocksContext build() { 28 | return new StarRocksContext(this); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/main/java/com/aliyun/fastmodel/transform/starrocks/format/TimeFunctionType.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.starrocks.format; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | import org.apache.commons.lang3.StringUtils; 6 | 7 | /** 8 | * @author 子梁 9 | * @date 2023/12/26 10 | */ 11 | @RequiredArgsConstructor 12 | public enum TimeFunctionType { 13 | 14 | DATE_TRUNC("date_trunc"), 15 | 16 | TIME_SLICE("time_slice"); 17 | 18 | @Getter 19 | private final String value; 20 | 21 | public static TimeFunctionType getByValue(String value) { 22 | TimeFunctionType[] timeFunctionTypes = TimeFunctionType.values(); 23 | for (TimeFunctionType TimeFunctionType : timeFunctionTypes) { 24 | if (StringUtils.equalsIgnoreCase(TimeFunctionType.getValue(), value)) { 25 | return TimeFunctionType; 26 | } 27 | } 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/main/java/com/aliyun/fastmodel/transform/starrocks/parser/visitor/StarRocksAstVisitor.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.starrocks.parser.visitor; 2 | 3 | import com.aliyun.fastmodel.transform.api.extension.visitor.ExtensionAstVisitor; 4 | import com.aliyun.fastmodel.transform.starrocks.parser.tree.datatype.StarRocksGenericDataType; 5 | 6 | /** 7 | * star rocks visitor 8 | * 9 | * @author panguanjing 10 | * @date 2023/9/12 11 | */ 12 | public interface StarRocksAstVisitor extends ExtensionAstVisitor { 13 | 14 | /** 15 | * visit starRocks GenericDataType 16 | * 17 | * @param starRocksGenericDataType genericDataType 18 | * @param context context 19 | * @return R 20 | */ 21 | default R visitStarRocksGenericDataType(StarRocksGenericDataType starRocksGenericDataType, C context) { 22 | return visitGenericDataType(starRocksGenericDataType, context); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/main/resources/starrocks/list.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alibaba/fast-modeling-language/a3c10ccc806d93386ac78c21991f93824bd4284a/fastmodel-transform/fastmodel-transform-starrocks/src/main/resources/starrocks/list.txt -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/test/java/com/aliyun/fastmodel/transform/starrocks/parser/tree/datatype/StarRocksDataTypeNameTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.starrocks.parser.tree.datatype; 2 | 3 | import com.aliyun.fastmodel.core.tree.datatype.IDataTypeName; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | /** 9 | * Desc: 10 | * 11 | * @author panguanjing 12 | * @date 2023/9/21 13 | */ 14 | public class StarRocksDataTypeNameTest { 15 | 16 | @Test 17 | public void testGetByValue() { 18 | IDataTypeName byValue = StarRocksDataTypeName.getByValue("array"); 19 | assertEquals(StarRocksDataTypeName.ARRAY, byValue); 20 | byValue = StarRocksDataTypeName.getByValue("json"); 21 | assertEquals(StarRocksDataTypeName.JSON, byValue); 22 | 23 | IDataTypeName byValue1 = StarRocksDataTypeName.getByValue("map"); 24 | assertEquals(StarRocksDataTypeName.Map, byValue1); 25 | } 26 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/test/java/com/aliyun/fastmodel/transform/starrocks/parser/util/StarRocksReservedWordUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.aliyun.fastmodel.transform.starrocks.parser.util; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertTrue; 6 | 7 | /** 8 | * Desc: 9 | * 10 | * @author panguanjing 11 | * @date 2023/11/6 12 | */ 13 | public class StarRocksReservedWordUtilTest { 14 | 15 | @Test 16 | public void isReservedKeyWord() { 17 | boolean reservedKeyWord = StarRocksReservedWordUtil.isReservedKeyWord("add"); 18 | assertTrue(reservedKeyWord); 19 | } 20 | } -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-starrocks/src/test/resources/starrocks/issue.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE `realtime_test` ( 2 | `update_time` datetime NOT NULL COMMENT '创建时间', 3 | `id` bigint NOT NULL COMMENT 'id', 4 | `value` text NULL COMMENT '值', 5 | `comment` text NULL COMMENT '备注', 6 | `crete_time` datetime NOT NULL COMMENT '创建时间' 7 | ) ENGINE=OLAP 8 | UNIQUE KEY(`update_time`, `id`) 9 | COMMENT '测试表' 10 | AUTO PARTITION BY RANGE (date_trunc(`update_time`, 'day')) 11 | () 12 | DISTRIBUTED BY HASH(`id`) BUCKETS AUTO 13 | PROPERTIES ( 14 | "file_cache_ttl_seconds" = "0", 15 | "is_being_synced" = "false", 16 | "storage_medium" = "hdd", 17 | "storage_format" = "V2", 18 | "inverted_index_storage_format" = "V2", 19 | "enable_unique_key_merge_on_write" = "true", 20 | "light_schema_change" = "true", 21 | "disable_auto_compaction" = "false", 22 | "enable_single_replica_compaction" = "false", 23 | "group_commit_interval_ms" = "10000", 24 | "group_commit_data_bytes" = "134217728", 25 | "enable_mow_light_delete" = "false" 26 | ); -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-zen/src/main/antlr4/com/aliyun/fastmodel/transform/zen/parser/FastModelZenParser.g4: -------------------------------------------------------------------------------- 1 | parser grammar FastModelZenParser; 2 | 3 | tokens { 4 | DELIMITER 5 | } 6 | 7 | options 8 | { 9 | tokenVocab= FastModelZenLexer; 10 | } 11 | 12 | zencoding 13 | : expression 14 | ; 15 | 16 | expression 17 | : atomicExpression #atomic 18 | | left=expression splitChar right=expression #brother 19 | ; 20 | 21 | splitChar 22 | : NEW_LINE | PLUS | COMMA | BITWISEOR 23 | ; 24 | 25 | atomicExpression 26 | : identifier 27 | | identifier STAR INTEGER_VALUE 28 | | atomicExpression splitAttrChar (identifier | string) 29 | ; 30 | splitAttrChar 31 | : DOT 32 | | TAB* 33 | | BLANK* 34 | ; 35 | identifier 36 | : Identifier 37 | ; 38 | 39 | string 40 | : StringLiteral 41 | ; 42 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-zen/src/main/java/com/aliyun/aliyun/transform/zen/converter/ZenNodeConvertContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.aliyun.transform.zen.converter; 18 | 19 | /** 20 | * 构建的context 21 | * 22 | * @author panguanjing 23 | * @date 2021/7/16 24 | */ 25 | public interface ZenNodeConvertContext { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /fastmodel-transform/fastmodel-transform-zen/src/main/java/com/aliyun/aliyun/transform/zen/parser/tree/BaseAtomicZenExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 Alibaba Group Holding Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.aliyun.aliyun.transform.zen.parser.tree; 18 | 19 | /** 20 | * base atomic 21 | * 22 | * @author panguanjing 23 | * @date 2021/7/17 24 | */ 25 | public abstract class BaseAtomicZenExpression extends BaseZenExpression { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | config.stopBubbling = true 2 | lombok.addLombokGeneratedAnnotation = true --------------------------------------------------------------------------------