Upload an array in HANA

安稳与你 提交于 2019-12-02 12:29:42

问题


I am new to SAP HANA and was recently migrating some of our databases to it and found it very good in performance.

The problem I am facing is that I am unable to upload an array column in HANA. But I found there is a way to INSERT an ARRAY in HANA using the method

  INSERT INTO T1 VALUES ( 1, ARRAY ( 1, 2, 3, 4 ) )

Since I have a .CSV file where the first two columns are integers and the third one is a bigint array from postgres and the it looks like:

input.csv
1,2,"{1545645,2652656,3545645}"
3,4,"{155535,244564654,346456456,448484,5456456465,664654564}"
9,12,"{14645646,24564564,3478484,447984894,5464646,644458648,745464,849494,9494848}"

How is it possible to upload an array column in HANA(SPS 12)? Any help is appreciated.


回答1:


This has been discussed here on SO before. Using the ARRAY() function is the only way to insert an ARRAY into an array-typed column.

If you want to load array data from a file you will have to use a custom loading program that constructs the ARRAY(....) function call for each record.

Depending on your use case, you might reconsider using other storage options for your data.



来源:https://stackoverflow.com/questions/41338263/upload-an-array-in-hana

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!