xtern commented on code in PR #4799: URL: https://github.com/apache/ignite-3/pull/4799#discussion_r1876049834
########## modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/kill/ItSqlKillCommandTest.java: ########## @@ -0,0 +1,153 @@ +/* + * 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.ignite.internal.sql.engine.kill; + +import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl; +import static org.apache.ignite.internal.sql.engine.util.SqlTestUtils.assertThrowsSqlException; +import static org.apache.ignite.internal.sql.engine.util.SqlTestUtils.expectQueryCancelled; +import static org.apache.ignite.internal.testframework.IgniteTestUtils.await; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.is; + +import java.util.List; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; +import org.apache.ignite.Ignite; +import org.apache.ignite.internal.app.IgniteImpl; +import org.apache.ignite.internal.lang.IgniteStringFormatter; +import org.apache.ignite.internal.sql.BaseSqlIntegrationTest; +import org.apache.ignite.internal.sql.engine.AsyncSqlCursor; +import org.apache.ignite.internal.sql.engine.InternalSqlRow; +import org.apache.ignite.internal.sql.engine.SqlQueryProcessor; +import org.apache.ignite.internal.sql.engine.exec.fsm.QueryInfo; +import org.apache.ignite.internal.sql.engine.util.MetadataMatcher; +import org.apache.ignite.lang.ErrorGroups.Common; +import org.apache.ignite.sql.ColumnType; +import org.apache.ignite.sql.ResultSet; +import org.apache.ignite.sql.SqlRow; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +/** + * Integration tests for SQL '{@code KILL}' statement. + */ +public class ItSqlKillCommandTest extends BaseSqlIntegrationTest { + @AfterEach + public void checkResourceLeak() { + assertThat(txManager().pending(), is(0)); + assertThat(queryProcessor().openedCursors(), is(0)); + } + + @Test + public void testKillQueryMetadata() { + assertQuery("KILL QUERY '00000000-0000-0000-0000-000000000000'") + .columnMetadata( + new MetadataMatcher().name("APPLIED").type(ColumnType.BOOLEAN).nullable(false) + ) + .check(); + } + + @Test + public void killWithInvalidQueryIdentifier() { + assertThrowsSqlException( + Common.INTERNAL_ERR, Review Comment: I hope I fixed it. Added javadoc comment in `OperationKillHandler#cancelAsync` ``` * @throws IllegalArgumentException If the operation identifier is not in the correct format. ``` This exception is handled separately in `KIllCommandHandler` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
