首页 \ 问答 \ 如何以编程方式在Vora中创建HANA临时表(Scala)(How to Create HANA Temp table in Vora Programmatically(Scala))

如何以编程方式在Vora中创建HANA临时表(Scala)(How to Create HANA Temp table in Vora Programmatically(Scala))

目前,使用以下语句创建临时表

val HANA_TABLE = s“”“
CREATE TEMPORARY TABLE TEMP_HANA
使用com.sap.spark.hana
选项(
路径“TABLE”,
主持人“HANA1”,
dbschema“SCHEMA”,
用户“USER”,
passwd“PASSWD”,
实例“22”
) “””
vc.sql(HANA_TABLE);

有没有办法在scala中以编程方式执行此操作? 喜欢
vc.read.format( “com.sap.spark.hana”)。选项(选项).loadTemp()

另外还有Vora的API吗?


At the moment a temp table is created using the following statement

val HANA_TABLE = s"""
CREATE TEMPORARY TABLE TEMP_HANA
USING com.sap.spark.hana
OPTIONS (
path "TABLE",
host "HANA1",
dbschema "SCHEMA",
user "USER",
passwd "PASSWD",
instance "22"
)"""
vc.sql(HANA_TABLE);

Is there a way to do this Programmatically in scala? like
vc.read.format("com.sap.spark.hana").options(options).loadTemp()

on a side note is there an API for Vora?


原文:https://stackoverflow.com/questions/37075119
更新时间:2022-11-23 20:11

最满意答案

请参阅Vora开发人员指南 - >章节“8访问SAP HANA中的数据”

你的例子可以这样写

val options = Map(
  "dbschema" -> "SCHEMA",
  "path"     -> "TABLE",
  "host"     -> "HANA1",
  "instance" -> "22",
  "user"     -> "USER",
  "passwd"   -> "PASSWD"
 ) 

val inputDF = vc.read.format("com.sap.spark.hana").options(options).load()
inputDF.registerTempTable("TEMP_HANA")

vc.sql("select * from TEMP_HANA").show

Please see the Vora Developer Guide -> Chapter "8 Accessing Data in SAP HANA"

Your example could be written in this way

val options = Map(
  "dbschema" -> "SCHEMA",
  "path"     -> "TABLE",
  "host"     -> "HANA1",
  "instance" -> "22",
  "user"     -> "USER",
  "passwd"   -> "PASSWD"
 ) 

val inputDF = vc.read.format("com.sap.spark.hana").options(options).load()
inputDF.registerTempTable("TEMP_HANA")

vc.sql("select * from TEMP_HANA").show

相关问答

更多

相关文章

更多

最新问答

更多
  • 在页面树中使用不同的域(Use different domains in page tree)
  • 为什么这个半圈不会成长?(Why won't this semi circle grow?)
  • 如何学习计算机编程?
  • 如何在单个gcc命令中将多个头文件包和库目录添加到搜索路径?(How to add multiple header include and library directories to the search path in a single gcc command?)
  • VB.Net绑定datagridview Comboboxcolumn到datagridviewTextboxColumn(VB.Net binding datagridview Comboboxcolumn to datagridviewTextboxColumn)
  • 数据库设计 - 当一个记录有许多属性时(database design - when one record has many properties)
  • MATLAB函数计算两个坐标(纬度和经度)之间的距离(MATLAB function to calculate distance between two coordinates (latitude and longitude))
  • 如何从TFS中的团队项目查询所有PBI的历史变更?(How to query all PBI's historical changes from a team project in TFS?)
  • 使用点表示法的Python导入无法按预期工作(Python import using dot notation doesn't work as expected)
  • 我们能否将String列设置为partitionColumn?(Can we able to set String column as partitionColumn?)
  • 下划线模板无法按预期工作(Underscore template doesn't work as intended)
  • 怎么写项目开发的文档?
  • 为什么我的plpgsql函数没有返回任何行(why does my plpgsql function return no rows)
  • 补偿ARM中断的延迟?(compensating latency on ARM interrupts?)
  • Clojure:半平铺嵌套序列(Clojure: Semi-Flattening a nested Sequence)
  • Array方法返回所有null元素而不是object元素(Array method returning all null elements instead of object elements)
  • 禁止基于IP的用户,而不允许管理员访问IP(Ban user based on IP without allowing Admin to access IP)
  • c#wpf多重绑定不是很流行(c# wpf Multibindings not aviable)
  • 亚马逊Generic是什么意思
  • 如何在jgroup复制的hashmap中为状态转移提供超时?(How to give timeout for state transfer in jgroup replicated hashmap?)
  • highcharts可以生成这样的3d柱形图吗?(Can highcharts generate a 3d column chart like this?)
  • 在rails控制台中选择第二个条目?(Selecting second entry in rails console?)
  • 通过了解标记并且不循环遍历项目,将值设置为列表视图的某列中的行(Set a value to a row in a certain column of a listview by knowing the tag and without looping through items)
  • 杀死一个分叉的孩子(Kill a Forked Child)
  • 什么是代码点和代码空间?(What is a code point and code space?)
  • 如何在ruby中获取第一个html标记和第二个html标记之间的内容(how to get the content between the first html tag and the second html tag in ruby)
  • 需要在recyclerview中获取新添加项的视图参考(Need to get the view reference of newly added item in recyclerview)
  • 我今天部计算机出现故障啊,在按开机后,主机便发出“迪”的开机的报警声啊,在上午上过后就不行了,我只是把计算机的所有线重插过就这样,因为D线太乱啊,整理下。但到晚上计算机又能开机啊,可以详细告诉原因吗
  • 将字符串转换为NumPy datetime64 dtype(Convert string to NumPy datetime64 dtype)
  • 模块VB.Net中的命名空间(Namespace in module VB.Net)