【问题标题】:pyspark df.write.format("jdbc") grant statement DB2pyspark df.write.format("jdbc") 授权声明 DB2
【发布时间】:2020-04-10 15:56:06
【问题描述】:

我想添加一个命令来添加我的授权语句,这样我就可以为用户提供对我使用 pyspark 加载的表的选择访问权限。

  df.write.format("jdbc")
    .option("url", "jdbc:db2:@//<host>:<port>/<srvice_name") \
    .option("user", "<user>") \
    .option("password", "<pass>") \
    .option("dbtable", db_query) \
    .option("driver", "com.ibm.db2.jcc.DB2Driver")

【问题讨论】:

  • 您的主题行和关键字提到了 Db2,但您只显示了 Oracle url 和 Oracke 驱动程序。编辑您的问题以解决该问题。

标签: jdbc pyspark db2 apache-zeppelin


【解决方案1】:

我假设您正在寻找 pyspark 中的选项。不知道是否可以使用pyspark。您可以使用其他数据库访问方法,如 SQL Alchemy。

How to grant access privileges to DB2 table using SQLAlchemy in a jupyter notebook

【讨论】:

    猜你喜欢
    • 2011-01-27
    • 1970-01-01
    • 2021-04-13
    • 2014-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多