【问题标题】:ParseException error when trying to insert into spark table尝试插入火花表时出现 ParseException 错误
【发布时间】:2021-03-04 22:17:49
【问题描述】:

尝试将 pyspark 数据帧 df 作为新记录插入到 spark 中的现有目录中

def path_exists(path):
  try:
    if len(dbutils.fs.ls(path)) > 0:
      return True
  except:
    return False

if (path_exists("abfss://famli-dev-workspace@famlisandbox.dfs.core.windows.net/path_to_table")) == True:
    df.write.mode("append").format("orc").insertInto("abfss://famli-dev-workspace@famlisandbox.dfs.core.windows.net/path_to_table")

但是得到了这个错误:

ParseException: 
mismatched input ':' expecting {<EOF>, '.', '-'}(line 1, pos 5)

这里有什么问题?

【问题讨论】:

    标签: dataframe apache-spark insert sql-insert


    【解决方案1】:

    你有一个缩进问题

    【讨论】:

    • 哪一行是缩进问题?
    • 从第一行开始,按照答案里的照片试试
    猜你喜欢
    • 2014-11-21
    • 1970-01-01
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 2016-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多