我正在尝试提取有关此问题的嵌入式连接凭据。但我收到以下错误。
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.types._ //import everything from the package
import org.apache.spark.sql.expressions.{Window => W}
import org.apache.spark.sql.{functions => F}
import org.apache.spark.SparkContext
import com.amazonaws.services.glue.GlueContext
import com.amazonaws.services.glue.util.GlueArgParser
import com.amazonaws.services.glue.DynamicFrame
import com.amazonaws.regions.Regions
import com.amazonaws.services.glue.model._
import com.amazonaws.services.glue.{AWSGlue, AWSGlueClient}
import scala.collection.JavaConverters.{mapAsJavaMapConverter, seqAsJavaListConverter}
import com.amazonaws.services.sagemaker.sparksdk.IAMRole
val sc = spark.sparkContext
val glueContext: GlueContext = new GlueContext(sc)
val region = Regions.fromName("us-east-1")
// Function to create AWS glue client
def glueClient(region: Regions):
AWSGlue = AWSGlueClient.builder().withRegion(region).build()
val glue = glueClient(region =region)
glue.getConnection("{Name: name-of-embedded-connection,HidePassword: False}")
遇到错误::71:错误:类型不匹配;找到:String("{Name: preprod-samtec-redw,HidePassword: False}") 需要:com.amazonaws.services.glue.model.GetConnectionRequestglue.getConnection("{Name: name-of-embedded-connection,HidePassword : 错误的}”)