Skip to content
Merged
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
3 changes: 3 additions & 0 deletions modules/calcite/src/main/codegen/config.fmpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ data: {
"COMPUTE"
"ASYNC"
"QUERY",
"LOCK"
"STATISTICS",
"REFRESH",
"ANALYZE",
Expand Down Expand Up @@ -107,6 +108,7 @@ data: {
"COMPUTE"
"ASYNC"
"QUERY"
"LOCK"
"STATISTICS"
"REFRESH"
"ANALYZE"
Expand Down Expand Up @@ -450,6 +452,7 @@ data: {
"SqlKillTransaction()",
"SqlKillComputeTask()",
"SqlKillQuery()",
"SqlKillLock()",
"SqlSavepoint()",
"SqlRollbackToSavepoint()",
"SqlCommitTransaction()",
Expand Down
12 changes: 12 additions & 0 deletions modules/calcite/src/main/codegen/includes/parserImpls.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,18 @@ SqlNode SqlKillQuery():
}
}

SqlNode SqlKillLock():
{
final Span s;
final SqlCharStringLiteral xid;
}
{
<KILL> { s = span(); } <LOCK>
xid = IgniteUuidLiteral() {
return IgniteSqlKill.createLockKill(s.end(this), xid);
}
}

SqlNode SqlCommitTransaction():
{
final Span s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.ignite.internal.processors.query.calcite.sql.IgniteSqlKill;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillComputeTask;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillContinuousQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillLock;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillScanQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillService;
Expand All @@ -66,6 +67,7 @@
import org.apache.ignite.internal.sql.command.SqlIndexColumn;
import org.apache.ignite.internal.sql.command.SqlKillComputeTaskCommand;
import org.apache.ignite.internal.sql.command.SqlKillContinuousQueryCommand;
import org.apache.ignite.internal.sql.command.SqlKillLockCommand;
import org.apache.ignite.internal.sql.command.SqlKillQueryCommand;
import org.apache.ignite.internal.sql.command.SqlKillScanQueryCommand;
import org.apache.ignite.internal.sql.command.SqlKillServiceCommand;
Expand Down Expand Up @@ -267,6 +269,11 @@ else if (cmd instanceof IgniteSqlKillQuery) {
IgniteSqlKillQuery cmd0 = (IgniteSqlKillQuery)cmd;
return new SqlKillQueryCommand(cmd0.nodeId(), cmd0.queryId(), cmd0.isAsync());
}
else if (cmd instanceof IgniteSqlKillLock) {
IgniteSqlKillLock cmd0 = (IgniteSqlKillLock)cmd;
IgniteUuid xid = IgniteUuid.fromString(cmd0.xid().getValueAs(String.class));
return new SqlKillLockCommand(xid);
}
else {
throw new IgniteSQLException("Unsupported native operation [" +
"cmdName=" + (cmd == null ? null : cmd.getClass().getSimpleName()) + "; " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.calcite.util.Pair;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillComputeTask;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillContinuousQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillLock;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillScanQuery;
import org.apache.ignite.internal.processors.query.calcite.sql.kill.IgniteSqlKillService;
Expand Down Expand Up @@ -93,6 +94,14 @@ public static IgniteSqlKill createQueryKill(
return new IgniteSqlKillQuery(pos, globalQueryId, nodeId, queryId, isAsync);
}

/** */
public static IgniteSqlKill createLockKill(
SqlParserPos pos,
SqlCharStringLiteral xid
) {
return new IgniteSqlKillLock(pos, xid);
}

/** */
public static Pair<UUID, Long> parseGlobalQueryId(String globalQryId) {
String[] ids = globalQryId.split("_");
Expand Down
Loading
Loading