Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,12 @@ public enum SQLVisitorRule {
ADMIN_CLEAN_TRASH("AdminCleanTrash", SQLStatementType.DAL),

CLEAN_ALL_PROFILE("CleanAllProfile", SQLStatementType.DAL),


CLEAN_PROFILE("CleanProfile", SQLStatementType.DAL),

PLAN_REPLAYER_PLAY("PlanReplayerPlay", SQLStatementType.DAL),

CREATE_EXTERNAL_RESOURCE("CreateExternalResource", SQLStatementType.DAL),

CREATE_SQL_BLOCK_RULE("CreateSqlBlockRule", SQLStatementType.DAL),

Expand Down Expand Up @@ -800,7 +804,9 @@ public enum SQLVisitorRule {
CREATE_GROUP("CreateGroup", SQLStatementType.DCL),

CREATE_MATERIALIZED_VIEW("CreateMaterializedView", SQLStatementType.DDL),


DORIS_REFRESH_MATERIALIZED_VIEW("DorisRefreshMaterializedView", SQLStatementType.DDL),

CREATE_MACRO("CreateMacro", SQLStatementType.DDL),

DROP_MACRO("DropMacro", SQLStatementType.DDL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,17 @@ cleanAllProfile
: CLEAN ALL PROFILE
;

cleanProfile
: CLEAN PROFILE
;

planReplayerPlay
: PLAN REPLAYER PLAY DOUBLE_QUOTED_TEXT
;

createExternalResource
: CREATE EXTERNAL RESOURCE resourceName PROPERTIES LP_ propertyAssignments RP_
;
// DORIS ADDED END

dorisAlterSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,18 @@ createMaterializedView
;
// DORIS ADDED END

// DORIS ADDED BEGIN
dorisRefreshMaterializedView
: REFRESH MATERIALIZED VIEW name (partitionSpec | COMPLETE | AUTO)
;
// DORIS ADDED END

// DORIS ADDED BEGIN
partitionSpec
: PARTITIONS LP_ identifierList RP_
;
// DORIS ADDED END

// DORIS ADDED BEGIN
buildMode
: BUILD (IMMEDIATE | DEFERRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,12 @@ EXTENDED
: E X T E N D E D
;

// DORIS ADDED BEGIN
EXTERNAL
: E X T E R N A L
;
// DORIS ADDED END

// DORIS ADDED BEGIN
EXTRACT_URL_PARAMETER
: E X T R A C T UL_ U R L UL_ P A R A M E T E R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ execute
| cancelBackup
| cancelLoadStatement
| cleanAllProfile
| cleanProfile
| planReplayerPlay
| dorisRefreshMaterializedView
| createExternalResource
// TODO consider refactor following sytax to SEMI_? EOF
) (SEMI_ EOF? | EOF)
| EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PluginPropertyValueContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminCleanTrashContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CleanAllProfileContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CleanProfileContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateExternalResourceContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.PlanReplayerPlayContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisAlterSystemContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AdminSetReplicaStatusContext;
Expand Down Expand Up @@ -233,6 +235,8 @@
import org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.TemporalLiteralValue;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCleanTrashStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanAllProfileStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanProfileStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateExternalResourceStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisPlanReplayerPlayStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaStatusStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaVersionStatement;
Expand Down Expand Up @@ -1272,7 +1276,17 @@ public ASTNode visitAdminCleanTrash(final AdminCleanTrashContext ctx) {
public ASTNode visitCleanAllProfile(final CleanAllProfileContext ctx) {
return new DorisCleanAllProfileStatement(getDatabaseType());
}


@Override
public ASTNode visitCleanProfile(final CleanProfileContext ctx) {
return new DorisCleanProfileStatement(getDatabaseType());
}

@Override
public ASTNode visitCreateExternalResource(final CreateExternalResourceContext ctx) {
return new DorisCreateExternalResourceStatement(getDatabaseType());
}

@Override
public ASTNode visitPlanReplayerPlay(final PlanReplayerPlayContext ctx) {
return new DorisPlanReplayerPlayStatement(getDatabaseType(), SQLUtils.getExactlyValue(ctx.DOUBLE_QUOTED_TEXT().getText()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateLikeClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateLogfileGroupContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateMaterializedViewContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisRefreshMaterializedViewContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateProcedureContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateServerContext;
import org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateSyncJobContext;
Expand Down Expand Up @@ -259,6 +260,7 @@
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.trigger.DropTriggerStatement;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.AlterViewStatement;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.CreateMaterializedViewStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisRefreshMaterializedViewStatement;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.CreateViewStatement;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.view.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.DeleteStatement;
Expand Down Expand Up @@ -1930,7 +1932,12 @@ public ASTNode visitDeallocate(final DeallocateContext ctx) {
public ASTNode visitCreateMaterializedView(final CreateMaterializedViewContext ctx) {
return new CreateMaterializedViewStatement(getDatabaseType());
}


@Override
public ASTNode visitDorisRefreshMaterializedView(final DorisRefreshMaterializedViewContext ctx) {
return new DorisRefreshMaterializedViewStatement(getDatabaseType());
}

@Override
public ASTNode visitCreateEncryptKey(final CreateEncryptKeyContext ctx) {
return new CreateEncryptKeyStatement(getDatabaseType());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.shardingsphere.sql.parser.statement.doris.dal;

import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;

/**
* Clean profile statement for Doris.
*/
public final class DorisCleanProfileStatement extends DALStatement {

public DorisCleanProfileStatement(final DatabaseType databaseType) {
super(databaseType);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.shardingsphere.sql.parser.statement.doris.dal;

import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;

/**
* Create external resource statement for Doris.
*/
public final class DorisCreateExternalResourceStatement extends DALStatement {

public DorisCreateExternalResourceStatement(final DatabaseType databaseType) {
super(databaseType);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.shardingsphere.sql.parser.statement.doris.ddl;

import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;

/**
* Refresh materialized view statement for Doris.
*/
public final class DorisRefreshMaterializedViewStatement extends DDLStatement {

public DorisRefreshMaterializedViewStatement(final DatabaseType databaseType) {
super(databaseType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.UnsetVariableStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCleanTrashStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanAllProfileStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanProfileStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateExternalResourceStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisPlanReplayerPlayStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminCopyTabletStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAdminSetReplicaStatusStatement;
Expand Down Expand Up @@ -56,6 +58,8 @@
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminCleanTrashStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCleanAllProfileStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCleanProfileStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCreateExternalResourceStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisPlanReplayerPlayStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminCopyTabletStatementAssert;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAdminSetReplicaStatusStatementAssert;
Expand Down Expand Up @@ -90,6 +94,8 @@
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCleanTrashStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCleanAllProfileStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCleanProfileStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateExternalResourceStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisPlanReplayerPlayStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminCopyTabletStatementTestCase;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAdminSetReplicaStatusStatementTestCase;
Expand Down Expand Up @@ -200,6 +206,10 @@ public static void assertIs(final SQLCaseAssertContext assertContext, final DALS
DorisShowLoadWarningsStatementAssert.assertIs(assertContext, (DorisShowLoadWarningsStatement) actual, (DorisShowLoadWarningsStatementTestCase) expected);
} else if (actual instanceof DorisCleanAllProfileStatement) {
DorisCleanAllProfileStatementAssert.assertIs(assertContext, (DorisCleanAllProfileStatement) actual, (DorisCleanAllProfileStatementTestCase) expected);
} else if (actual instanceof DorisCleanProfileStatement) {
DorisCleanProfileStatementAssert.assertIs(assertContext, (DorisCleanProfileStatement) actual, (DorisCleanProfileStatementTestCase) expected);
} else if (actual instanceof DorisCreateExternalResourceStatement) {
DorisCreateExternalResourceStatementAssert.assertIs(assertContext, (DorisCreateExternalResourceStatement) actual, (DorisCreateExternalResourceStatementTestCase) expected);
} else if (actual instanceof DorisPlanReplayerPlayStatement) {
DorisPlanReplayerPlayStatementAssert.assertIs(assertContext, (DorisPlanReplayerPlayStatement) actual, (DorisPlanReplayerPlayStatementTestCase) expected);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCleanProfileStatement;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCleanProfileStatementTestCase;

/**
* Clean profile statement assert for Doris.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class DorisCleanProfileStatementAssert {

/**
* Assert clean profile statement is correct with expected parser result.
*
* @param assertContext assert context
* @param actual actual clean profile statement
* @param expected expected clean profile statement test case
*/
public static void assertIs(final SQLCaseAssertContext assertContext, final DorisCleanProfileStatement actual, final DorisCleanProfileStatementTestCase expected) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateExternalResourceStatement;
import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateExternalResourceStatementTestCase;

/**
* Create external resource statement assert for Doris.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class DorisCreateExternalResourceStatementAssert {

/**
* Assert create external resource statement is correct with expected parser result.
*
* @param assertContext assert context
* @param actual actual create external resource statement
* @param expected expected create external resource statement test case
*/
public static void assertIs(final SQLCaseAssertContext assertContext, final DorisCreateExternalResourceStatement actual, final DorisCreateExternalResourceStatementTestCase expected) {
}
}
Loading
Loading