Преобразование файла CSV в паркет также необходимо объединить поля? - PullRequest
0 голосов
/ 28 апреля 2020

Я пытаюсь преобразовать CSV-файл в паркет с помощью клея, также хочу объединить поля тоже. Я успешно могу конвертировать файл, но конкатенация не работает. Поэтому я хочу код для процесса конкатенации.

datasource1 = datasource0.toDF().withColumn("adressjoin", concat(col("addressline1"), col("addressline2")))
datasource2 = DynamicFrame.fromDF(datasource1, glueContext, "datasource2")
applymapping1 = ApplyMapping.apply(frame = datasource2, mappings = [("ordernumber", "long", "ordernumber", "long"), ("quantityordered", "long", "quantityordered", "long"), ("priceeach", "double", "priceeach", "double"), ("orderlinenumber", "long", "orderlinenumber", "long"), ("sales", "double", "sales", "double"), ("orderdate", "string", "orderdate", "string"), ("status", "string", "status", "string"), ("qtr_id", "long", "qtr_id", "long"), ("month_id", "long", "month_id", "long"), ("year_id", "long", "year_id", "long"), ("productline", "string", "productline", "string"), ("msrp", "long", "msrp", "long"), ("productcode", "string", "productcode", "string"), ("customername", "string", "customername", "string"), ("phone", "string", "phone", "string"),("adressjoin", "string", "adressjoin", "string"), ("addressline1", "string", "addressline1", "string"), ("addressline2", "string", "addressline2", "string"), ("city", "string", "city", "string"), ("state", "string", "state", "string"), ("postalcode", "string", "postalcode", "string"), ("country", "string", "country", "string"), ("territory", "string", "territory", "string"), ("contactlastname", "string", "contactlastname", "string"), ("contactfirstname", "string", "contactfirstname", "string"), ("dealsize", "string", "dealsize", "string"), ("year", "string", "year", "string")], transformation_ctx = "applymapping1")

В коде я пытаюсь объединить 2 поля адреса в 1 как addressjoin, но конкатенация не работает, поэтому мне нужна помощь в этом.

...