Skip to content
Closed
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 @@ -22,11 +22,11 @@
import io.trino.spi.block.VariableWidthBlockBuilder;
import io.trino.sql.analyzer.TypeSignatureProvider;
import io.trino.sql.tree.QualifiedName;
import org.testcontainers.shaded.org.apache.commons.lang.StringUtils;
import org.testng.annotations.Test;

import java.util.List;

import static com.google.common.base.Strings.repeat;
import static io.airlift.slice.Slices.utf8Slice;
import static io.trino.block.BlockAssertions.createBooleansBlock;
import static io.trino.block.BlockAssertions.createStringsBlock;
Expand Down Expand Up @@ -82,7 +82,7 @@ public void testInputEmptyState()
@Test
public void testInputOverflowOverflowFillerTooLong()
{
String overflowFillerTooLong = StringUtils.repeat(".", 65_537);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will be needed for Airbase 127. I just noticed they didn't get into 126.

String overflowFillerTooLong = repeat(".", 65_537);

SingleListaggAggregationState state = new SingleListaggAggregationState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.shaded.org.apache.commons.lang.StringUtils;

import static com.google.common.base.Strings.repeat;
import static io.trino.spi.StandardErrorCode.EXCEEDED_FUNCTION_MEMORY_LIMIT;
import static io.trino.spi.block.PageBuilderStatus.DEFAULT_MAX_PAGE_SIZE_IN_BYTES;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -330,7 +330,7 @@ public void testListaggQueryWithOrderingAndGrouping()
@Test
public void testListaggQueryOverflowError()
{
String tooLargeValue = StringUtils.repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES);
String tooLargeValue = repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES);
assertThatThrownBy(() -> assertions.query(
"SELECT LISTAGG(value, ',' ON OVERFLOW ERROR) WITHIN GROUP (ORDER BY value) " +
"FROM (VALUES '" + tooLargeValue + "','Trino') t(value) "))
Expand All @@ -342,7 +342,7 @@ public void testListaggQueryOverflowError()
@Test
public void testListaggQueryOverflowErrorGrouping()
{
String tooLargeValue = StringUtils.repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES);
String tooLargeValue = repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES);
assertThatThrownBy(() -> assertions.query(
"SELECT id, LISTAGG(value, ',' ON OVERFLOW ERROR) WITHIN GROUP (ORDER BY value) " +
"FROM (VALUES " +
Expand All @@ -360,7 +360,7 @@ public void testListaggQueryOverflowErrorGrouping()
@Test
public void testListaggQueryOverflowTruncateWithoutCountAndWithoutOverflowFiller()
{
String largeValue = StringUtils.repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 6);
String largeValue = repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 6);
assertThat(assertions.query(
"SELECT LISTAGG(value, ',' ON OVERFLOW TRUNCATE WITHOUT COUNT) WITHIN GROUP (ORDER BY value) " +
"FROM (VALUES '" + largeValue + "', 'trino', 'rocks') t(value) "))
Expand All @@ -370,7 +370,7 @@ public void testListaggQueryOverflowTruncateWithoutCountAndWithoutOverflowFiller
@Test
public void testListaggQueryOverflowTruncateWithCountAndWithOverflowFiller()
{
String largeValue = StringUtils.repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 12);
String largeValue = repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 12);
assertThat(assertions.query(
"SELECT LISTAGG(value, ',' ON OVERFLOW TRUNCATE '.....' WITH COUNT) WITHIN GROUP (ORDER BY value) " +
"FROM (VALUES '" + largeValue + "', 'trino', 'sql', 'everything') t(value) "))
Expand All @@ -380,7 +380,7 @@ public void testListaggQueryOverflowTruncateWithCountAndWithOverflowFiller()
@Test
public void testListaggQueryGroupingOverflowTruncateWithCountAndWithOverflowFiller()
{
String largeValue = StringUtils.repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 12);
String largeValue = repeat("a", DEFAULT_MAX_PAGE_SIZE_IN_BYTES - 12);
assertThat(assertions.query(
"SELECT id, LISTAGG(value, ',' ON OVERFLOW TRUNCATE '.....' WITH COUNT) WITHIN GROUP (ORDER BY value) " +
"FROM (VALUES " +
Expand Down
9 changes: 0 additions & 9 deletions plugin/trino-delta-lake/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@

<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>

<!--
Project's default for air.test.parallel is 'methods'. By design, 'instances' runs all the methods in the same instance in the same thread,
but two methods on two different instances will be running in different threads.
As a side effect, it prevents TestNG from initializing multiple test instances upfront, which happens with 'methods'.
A potential downside can be long tail single-threaded execution of a single long test class.
TODO (https://github.com/trinodb/trino/issues/11294) remove when we upgrade to surefire with https://issues.apache.org/jira/browse/SUREFIRE-1967
-->
<air.test.parallel>instances</air.test.parallel>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster;
import org.apache.phoenix.shaded.org.apache.zookeeper.server.ZooKeeperServer;

import javax.annotation.concurrent.GuardedBy;

Expand Down Expand Up @@ -79,7 +78,7 @@ private TestingPhoenixServer()
// keep references to prevent GC from resetting the log levels
apacheLogger = java.util.logging.Logger.getLogger("org.apache");
apacheLogger.setLevel(Level.SEVERE);
zookeeperLogger = java.util.logging.Logger.getLogger(ZooKeeperServer.class.getName());
zookeeperLogger = java.util.logging.Logger.getLogger("org.apache.phoenix.shaded.org.apache.zookeeper.server.ZooKeeperServer");
zookeeperLogger.setLevel(Level.OFF);
securityLogger = java.util.logging.Logger.getLogger("SecurityLogger.org.apache");
securityLogger.setLevel(Level.SEVERE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster;
import org.apache.phoenix.shaded.org.apache.zookeeper.server.ZooKeeperServer;

import javax.annotation.concurrent.GuardedBy;

Expand Down Expand Up @@ -79,7 +78,7 @@ private TestingPhoenixServer()
// keep references to prevent GC from resetting the log levels
apacheLogger = java.util.logging.Logger.getLogger("org.apache");
apacheLogger.setLevel(Level.SEVERE);
zookeeperLogger = java.util.logging.Logger.getLogger(ZooKeeperServer.class.getName());
zookeeperLogger = java.util.logging.Logger.getLogger("org.apache.phoenix.shaded.org.apache.zookeeper.server.ZooKeeperServer");
zookeeperLogger.setLevel(Level.OFF);
securityLogger = java.util.logging.Logger.getLogger("SecurityLogger.org.apache");
securityLogger.setLevel(Level.SEVERE);
Expand Down
7 changes: 0 additions & 7 deletions plugin/trino-pinot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>
<dep.pinot.version>0.10.0</dep.pinot.version>
<!--
Project's default for air.test.parallel is 'methods'. By design, 'instances' makes TestNG run tests from one class in a single thread.
As a side effect, it prevents TestNG from initializing multiple test instances upfront, which happens with 'methods'.
A potential downside can be long tail single-threaded execution of a single long test class.
TODO (https://github.com/trinodb/trino/issues/11294) remove when we upgrade to surefire with https://issues.apache.org/jira/browse/SUREFIRE-1967
-->
<air.test.parallel>instances</air.test.parallel>
</properties>

<repositories>
Expand Down
9 changes: 0 additions & 9 deletions plugin/trino-sqlserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@

<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>

<!--
Project's default for air.test.parallel is 'methods'. By design, 'instances' runs all the methods in the same instance in the same thread,
but two methods on two different instances will be running in different threads.
As a side effect, it prevents TestNG from initializing multiple test instances upfront, which happens with 'methods'.
A potential downside can be long tail single-threaded execution of a single long test class.
TODO (https://github.com/trinodb/trino/issues/11294) remove when we upgrade to surefire with https://issues.apache.org/jira/browse/SUREFIRE-1967
-->
<air.test.parallel>instances</air.test.parallel>
</properties>

<dependencies>
Expand Down
18 changes: 16 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.airlift</groupId>
<artifactId>airbase</artifactId>
<version>123</version>
<version>126-SNAPSHOT</version>
</parent>

<groupId>io.trino</groupId>
Expand Down Expand Up @@ -174,6 +174,20 @@
<module>testing/trino-tests</module>
</modules>

<!-- TODO remove this -->
<repositories>
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<!-- Trino -->
Expand Down Expand Up @@ -1678,7 +1692,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.28</version>
<version>1.30</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
10 changes: 0 additions & 10 deletions testing/trino-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@

<properties>
<air.main.basedir>${project.parent.basedir}</air.main.basedir>

<!--
Project's default for air.test.parallel is 'methods'. By design, 'instances' runs all the methods in the same instance in the same thread,
but two methods on two different instances will be running in different threads.
As a side effect, it prevents TestNG from initializing multiple test instances upfront, which happens with 'methods'.
This reduces tests' memory footprint, which generally allows them to complete faster.
A potential downside can be long tail single-threaded execution of a single long test class.
TODO (https://github.com/trinodb/trino/issues/11294) remove when we upgrade to surefire with https://issues.apache.org/jira/browse/SUREFIRE-1967
-->
<air.test.parallel>instances</air.test.parallel>
</properties>

<dependencies>
Expand Down