birTiwana commented on a change in pull request #10920: URL: https://github.com/apache/druid/pull/10920#discussion_r635283172
########## File path: extensions-core/spark-extensions/src/main/scala/org/apache/druid/spark/clients/DruidMetadataClient.scala ########## @@ -0,0 +1,171 @@ +/* + * 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.druid.spark.clients + +import com.fasterxml.jackson.core.`type`.TypeReference +import com.fasterxml.jackson.databind.ObjectMapper +import com.google.common.base.Suppliers +import org.apache.druid.indexer.SQLMetadataStorageUpdaterJobHandler +import org.apache.druid.java.util.common.StringUtils +import org.apache.druid.metadata.{MetadataStorageConnectorConfig, MetadataStorageTablesConfig, + PasswordProvider, SQLMetadataConnector} +import org.apache.druid.spark.MAPPER +import org.apache.druid.spark.configuration.{Configuration, DruidConfigurationKeys} +import org.apache.druid.spark.mixins.Logging +import org.apache.druid.spark.registries.SQLConnectorRegistry +import org.apache.druid.timeline.DataSegment +import org.skife.jdbi.v2.{DBI, Handle} + +import java.io.ByteArrayInputStream +import java.util.Properties +import scala.collection.JavaConverters.{asScalaBufferConverter, mapAsJavaMapConverter} + +class DruidMetadataClient( + metadataDbType: String, + host: String, + port: Int, + connectUri: String, + user: String, + passwordProviderSer: String, + dbcpMap: Properties, + base: String = "druid" + ) extends Logging { + private lazy val druidMetadataTableConfig = MetadataStorageTablesConfig.fromBase(base) + private lazy val dbcpProperties = new Properties() + dbcpProperties.putAll(dbcpMap) Review comment: I am simply doing `mvn clean package -pl extensions-core/spark-extensions` . This actually seems like a scala version mismatch issue for me. I am using `2.13.5` but I think the expectation is to use `2.12.11` or `2.12.10` instead? Adding some stack trace here: `[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) @ druid-spark-extensions --- [WARNING] Expected all dependencies to require Scala version: 2.12.11 [WARNING] com.fasterxml.jackson.module:jackson-module-scala_2.12:2.10.2 requires scala version: 2.12.10 [WARNING] Multiple versions of scala libraries detected! [INFO] /Users/btiwana/Downloads/druid-spark/druid/extensions-core/spark-extensions/src/main/scala:-1: info: compiling [INFO] Compiling 29 source files to /Users/btiwana/Downloads/druid-spark/druid/extensions-core/spark-extensions/target/classes at 1621433638727 [ERROR] /Users/btiwana/Downloads/druid-spark/druid/extensions-core/spark-extensions/src/main/scala/org/apache/druid/spark/utils/DruidMetadataClient.scala:52: error: ambiguous reference to overloaded definition, [ERROR] both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit [ERROR] and method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit [ERROR] match argument types (java.util.Properties) [ERROR] dbcpProperties.putAll(dbcpMap) [ERROR] ^ [ERROR] one error found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 29.832 s [INFO] Finished at: 2021-05-19T07:14:04-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project druid-spark-extensions: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException ` -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
