Skip to content

Commit

Permalink
SNOW-923322 Upgrade to Scala 2.12.18 (#61)
Browse files Browse the repository at this point in the history
* reformat

* add upgrade to scala 2.12.15

* update to scala 2.12.18

* add profile

* update test-coverage

* fix pom
  • Loading branch information
sfc-gh-bli authored Nov 7, 2023
1 parent c8a0e60 commit c9d4942
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 26 deletions.
8 changes: 7 additions & 1 deletion fips-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.12.11</scala.version>
<scala.version>2.12.18</scala.version>
<scala.compat.version>2.12</scala.compat.version>
<spec2.version>4.2.0</spec2.version>
<snowflake.jdbc.version>3.14.1</snowflake.jdbc.version>
Expand Down Expand Up @@ -478,6 +478,12 @@
</build>

<profiles>
<profile>
<id>test-coverage</id>
<properties>
<scala.version>2.12.15</scala.version>
</properties>
</profile>
<profile>
<id>ossrh-deploy</id>
<activation>
Expand Down
40 changes: 25 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.12.11</scala.version>
<scala.version>2.12.18</scala.version>
<scala.compat.version>2.12</scala.compat.version>
<spec2.version>4.2.0</spec2.version>
<snowflake.jdbc.version>3.14.1</snowflake.jdbc.version>
<version.scala.binary>${scala.compat.version}</version.scala.binary>
<doctitle>Snowpark ${project.version}</doctitle>
<scoverage.plugin.version>1.4.0</scoverage.plugin.version>
<scoverage.plugin.version>1.4.11</scoverage.plugin.version>
<bouncycastle.version>1.64</bouncycastle.version>
<scoverage.aggregate>true</scoverage.aggregate>
<scalaPluginVersion>4.3.0</scalaPluginVersion>
Expand Down Expand Up @@ -443,19 +443,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>${scoverage.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal> <!-- or integration-check -->
</goals>
<phase>prepare-package</phase> <!-- or any other phase -->
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down Expand Up @@ -506,6 +493,29 @@
</build>

<profiles>
<profile>
<id>test-coverage</id>
<properties>
<scala.version>2.12.15</scala.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>${scoverage.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal> <!-- or integration-check -->
</goals>
<phase>prepare-package</phase> <!-- or any other phase -->
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>ossrh-deploy</id>
<activation>
Expand Down
2 changes: 1 addition & 1 deletion scripts/jenkins_regress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exit_code_decorator(){
gpg --quiet --batch --yes --decrypt --passphrase="$GPG_KEY" --output profile.properties scripts/profile.properties.gpg

exit_code_decorator "mvn clean compile"
exit_code_decorator "mvn -Dgpg.skip -DtagsToExclude=com.snowflake.snowpark.PerfTest -e scoverage:report"
exit_code_decorator "mvn -Dgpg.skip -DtagsToExclude=com.snowflake.snowpark.PerfTest -e scoverage:report -P test-coverage"

version=`git rev-parse HEAD`

Expand Down
13 changes: 6 additions & 7 deletions src/main/java/com/snowflake/snowpark_java/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2365,14 +2365,13 @@ public static Column regexp_count(Column strExpr, Column pattern) {
*/
public static Column regexp_replace(Column strExpr, Column pattern) {
return new Column(
com.snowflake.snowpark.functions.regexp_replace(
strExpr.toScalaColumn(), pattern.toScalaColumn()));
com.snowflake.snowpark.functions.regexp_replace(
strExpr.toScalaColumn(), pattern.toScalaColumn()));
}

/**
* Returns the subject with the specified pattern (or all occurrences of the pattern)
* replaced by a replacement string. If no matches are found, returns the original
* subject.
* Returns the subject with the specified pattern (or all occurrences of the pattern) replaced by
* a replacement string. If no matches are found, returns the original subject.
*
* @param strExpr The input string
* @param pattern The pattern
Expand All @@ -2382,8 +2381,8 @@ public static Column regexp_replace(Column strExpr, Column pattern) {
*/
public static Column regexp_replace(Column strExpr, Column pattern, Column replacement) {
return new Column(
com.snowflake.snowpark.functions.regexp_replace(
strExpr.toScalaColumn(), pattern.toScalaColumn(), replacement.toScalaColumn()));
com.snowflake.snowpark.functions.regexp_replace(
strExpr.toScalaColumn(), pattern.toScalaColumn(), replacement.toScalaColumn()));
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/com/snowflake/snowpark/functions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,6 @@ object functions {
def regexp_replace(strExpr: Column, pattern: Column, replacement: Column): Column =
builtin("regexp_replace")(strExpr, pattern, replacement)


/**
* Removes all occurrences of a specified strExpr,
* and optionally replaces them with replacement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ public void regexp_replace() {
Column replacement = Functions.lit("ch");
Row[] expected1 = {Row.create("cht"), Row.create("chg"), Row.create("chuse")};
checkAnswer(
df.select(Functions.regexp_replace(df.col("a"), pattern, replacement)), expected1, false);
df.select(Functions.regexp_replace(df.col("a"), pattern, replacement)), expected1, false);
}

@Test
Expand Down

0 comments on commit c9d4942

Please sign in to comment.