CTTY commented on code in PR #12772:
URL: https://github.com/apache/hudi/pull/12772#discussion_r1975803994
##########
.github/workflows/bot.yml:
##########
@@ -210,21 +210,24 @@ jobs:
- scalaProfile: "scala-2.12"
sparkProfile: "spark3.4"
sparkModules: "hudi-spark-datasource/hudi-spark3.4.x"
+ - scalaProfile: "scala-2.13"
+ sparkProfile: "spark4"
+ sparkModules: "hudi-spark-datasource/hudi-spark4.0.x"
steps:
- uses: actions/checkout@v3
- - name: Set up JDK 8
+ - name: Set up JDK 17
uses: actions/setup-java@v3
with:
- java-version: '8'
+ java-version: '17'
distribution: 'temurin'
architecture: x64
- name: Build Project
env:
SCALA_PROFILE: ${{ matrix.scalaProfile }}
SPARK_PROFILE: ${{ matrix.sparkProfile }}
run:
- mvn clean install -T 2 -D"$SCALA_PROFILE" -D"$SPARK_PROFILE"
-DskipTests=true $MVN_ARGS -am -pl
"hudi-examples/hudi-examples-spark,hudi-common,$SPARK_COMMON_MODULES,$SPARK_MODULES"
+ mvn clean install -T 2 -Pjava17 -D"$SCALA_PROFILE"
-D"$SPARK_PROFILE" -DskipTests=true $MVN_ARGS -am -pl
"hudi-examples/hudi-examples-spark,hudi-common,$SPARK_COMMON_MODULES,$SPARK_MODULES"
Review Comment:
Maybe we should bump the default java version to 17
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieFileIndex.scala:
##########
@@ -538,10 +538,10 @@ object HoodieFileIndex extends Logging {
properties.setProperty(PARTITIONPATH_FIELD.key,
HoodieTableConfig.getPartitionFieldPropForKeyGenerator(tableConfig).orElse(""))
// for simple bucket index, we need to set the INDEX_TYPE,
BUCKET_INDEX_HASH_FIELD, BUCKET_INDEX_NUM_BUCKETS
- val dataBase = Some(tableConfig.getDatabaseName)
+ val dataBase = if
(StringUtils.isNullOrEmpty(tableConfig.getDatabaseName)) "default" else
tableConfig.getDatabaseName
Review Comment:
I also noticed this issue and created #12885. We should close #12885 once
this PR is merged. This issue is not related to Spark 4 upgrade though
##########
hudi-spark-datasource/hudi-spark4-common/pom.xml:
##########
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>hudi-spark-datasource</artifactId>
+ <groupId>org.apache.hudi</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>hudi-spark4-common</artifactId>
+
+ <properties>
+ <main.basedir>${project.parent.parent.basedir}</main.basedir>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
Review Comment:
Maybe we should consider bump the default java version
##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/index/hbase/TestSparkHoodieHBaseIndex.java:
##########
@@ -102,6 +102,7 @@
* (see one problem here : https://issues.apache.org/jira/browse/HBASE-15835).
Hence, the need to use
* {@link MethodOrderer.Alphanumeric} to make sure the tests run in order.
Please alter the order of tests running carefully.
*/
+@Disabled
Review Comment:
Is there any known issues to this test? I can't remember any
##########
hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/adapter/BaseSpark3Adapter.scala:
##########
@@ -108,4 +115,37 @@ abstract class BaseSpark3Adapter extends SparkAdapter with
Logging {
}
def stopSparkContext(jssc: JavaSparkContext, exitCode: Int): Unit
+
+ override def createInternalRow(commitTime: UTF8String,
+ commitSeqNumber: UTF8String,
+ recordKey: UTF8String,
+ partitionPath: UTF8String,
+ fileName: UTF8String,
+ sourceRow: InternalRow,
+ sourceContainsMetaFields: Boolean):
HoodieInternalRow = {
+ new Spark3HoodieInternalRow(commitTime, commitSeqNumber, recordKey,
partitionPath, fileName, sourceRow, sourceContainsMetaFields)
+ }
+
+ override def createInternalRow(metaFields: Array[UTF8String],
+ sourceRow: InternalRow,
+ sourceContainsMetaFields: Boolean):
HoodieInternalRow = {
+ new Spark3HoodieInternalRow(metaFields, sourceRow,
sourceContainsMetaFields)
+ }
+
+ override def createHoodiePartitionCDCFileGroupMapping(partitionValues:
InternalRow,
+ fileSplits:
List[HoodieCDCFileSplit]): HoodiePartitionCDCFileGroupMapping = {
+ new Spark3HoodiePartitionCDCFileGroupMapping(partitionValues, fileSplits)
+ }
+
+ override def createHoodiePartitionFileSliceMapping(values: InternalRow,
+ slices: Map[String,
FileSlice]): HoodiePartitionFileSliceMapping = {
+ new Spark3HoodiePartitionFileSliceMapping(values, slices)
+ }
+
+ override def newParseException(command: Option[String],
+ exception: AnalysisException,
+ start: Origin,
+ stop: Origin): ParseException = {
+ new ParseException(command, exception.getMessage, start, stop)
Review Comment:
nit: Might as well add a new class `HoodieParseException` just like
`HoodieAnalysisException`
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/CreateHoodieTableAsSelectCommand.scala:
##########
@@ -100,7 +101,8 @@ case class CreateHoodieTableAsSelectCommand(
HiveSyncConfigHolder.HIVE_TABLE_PROPERTIES.key ->
ConfigUtils.configToString(updatedTable.properties.asJava),
HoodieWriteConfig.COMBINE_BEFORE_INSERT.key -> "false",
DataSourceWriteOptions.SQL_INSERT_MODE.key ->
InsertMode.NON_STRICT.value(),
- DataSourceWriteOptions.SQL_ENABLE_BULK_INSERT.key -> "true"
+ DataSourceWriteOptions.SQL_ENABLE_BULK_INSERT.key -> "true",
+ "path" -> tablePath
Review Comment:
Why is `path` needed again? Did we see any issues with this?
--
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]