l_schemas=["OCC","dbo","one"]# list for storing your schemas
l_tables=["table1","table2","table3"] # list for storing respective tables in that particular indexed schema
for i in range(0,len(l_schemas)):
s=l_schemas[i]+"."+l_tables[i] # concatenation and making as schema.table_name
df.write.mode("overwrite") \
.format("jdbc") \
.option("url", jdbcUrl) \
.option("dbtable", s)\
.save()
1条答案
按热度按时间93ze6v8z1#
谢谢你@Alex Ott,将它作为一个答案,它将对其他社区成员有用
我尝试在我的环境中重现相同的结果,并使用dbo.schema得到以下结果:
如果有多个模式,则使用串联和making作为
schema.table_name