Skip to content

Commit

Permalink
Fix Java8 compat in Vector Transform tests (#11289)
Browse files Browse the repository at this point in the history
This commit replaces the usage of `"".repeat(...)` added in #11268
with java8 compatible invocations
  • Loading branch information
dinoocch authored Aug 8, 2023
1 parent f4e1ce9 commit a6e23c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.pinot.core.operator.transform.function;

import org.apache.commons.lang3.StringUtils;
import org.apache.pinot.common.request.context.ExpressionContext;
import org.apache.pinot.common.request.context.RequestContextUtils;
import org.testng.annotations.DataProvider;
Expand Down Expand Up @@ -60,7 +61,7 @@ public void testVectorDimsTransformFunction() {
@DataProvider(name = "testVectorTransformFunctionDataProvider")
public Object[][] testVectorTransformFunctionDataProvider() {
String zeroVectorLiteral = "ARRAY[0.0"
+ ",0.0".repeat(VECTOR_DIM_SIZE - 1)
+ StringUtils.repeat(",0.0", VECTOR_DIM_SIZE - 1)
+ "]";
return new Object[][]{
new Object[]{"cosineDistance(vector1, vector2)", 0.1, 0.4},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.config.table.TableType;
import org.apache.pinot.spi.data.FieldSpec;
Expand Down Expand Up @@ -131,10 +132,10 @@ public void testQueriesWithLiterals(boolean useMultiStageQueryEngine)
throws Exception {
setUseMultiStageQueryEngine(useMultiStageQueryEngine);
String zeroVectorStringLiteral = "ARRAY[0.0"
+ ", 0.0".repeat(VECTOR_DIM_SIZE - 1)
+ StringUtils.repeat(", 0.0", VECTOR_DIM_SIZE - 1)
+ "]";
String oneVectorStringLiteral = "ARRAY[1.0"
+ ", 1.0".repeat(VECTOR_DIM_SIZE - 1)
+ StringUtils.repeat(", 1.0", VECTOR_DIM_SIZE - 1)
+ "]";
String query =
String.format("SELECT "
Expand Down

0 comments on commit a6e23c1

Please sign in to comment.