Amazon web services AWS GLUE ETL-如何在新列中显示值

Amazon web services AWS GLUE ETL-如何在新列中显示值,amazon-web-services,pyspark,aws-glue,Amazon Web Services,Pyspark,Aws Glue,我试图在Glue ETL中连接一个新列,但有一个错误我不知道如何解决。此代码段中出现错误datasource2=DynamicFrame(datasource1,glueContext) 错误: line 25 datasource2 = DynamicFrame(datasource1, glueContext) ^ SyntaxError: invalid syntax During handling of the above exception, another exception occ

我试图在Glue ETL中连接一个新列,但有一个错误我不知道如何解决。此代码段中出现错误
datasource2=DynamicFrame(datasource1,glueContext)

错误:

line 25 datasource2 = DynamicFrame(datasource1, glueContext) ^ SyntaxError: invalid syntax During handling of the above exception, another exception occurred: Traceback (most recent call last): File "runscript3.py", line 86, in <module> while "runpy.py" in new_stack.tb_frame.f_code.co_filename: AttributeError: 'NoneType' object has no attribute 'tb_frame'

您可以尝试此方法来解决pyspark(将动态帧转换为数据帧)中的错误

改变

datasource2 = DynamicFrame(datasource1, glueContext) //it will work on scala spark


您可以尝试此方法来解决pyspark(将动态帧转换为数据帧)中的错误

改变

datasource2 = DynamicFrame(datasource1, glueContext) //it will work on scala spark


一个简单的语法错误:您忘记了行
datasource1=datasource0.toDF()上的右括号。withColumn(“adresjoin”、concat(col(“streettype”)、col(“street”)
我没有导入col类,我做了这个更改,它成功了。datasource1=datasource0.toDF()。withColumn(“adresjoin”、concat(datasource0[“streettype”)、datasource0[“street”]
DynamicFrame.fromDF(datasource1,glueContext,“datasource2”)
一个简单的语法错误:您忘记了行
datasource1=datasource0.toDF()中的右括号
我没有导入col类,我做了这个更改,它成功了。datasource1=datasource0.toDF()。withColumn(“地址连接”,concat(datasource0[“streettype]”,datasource0[“street”])
DynamicFrame.fromDF(datasource1,glueContext,“datasource2”)
datasource2 = DynamicFrame.fromDF(datasource1, glueContext, datasource2)