在HANA中上传阵列 [英] Upload an array in HANA

查看:65
本文介绍了在HANA中上传阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SAP HANA的新手,最近将我们的一些数据库迁移到该数据库中,发现它的性能非常好.

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

我面临的问题是我无法在HANA中上载array column.但是我发现有一种方法可以使用

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 ) )

因为我有一个.CSV文件,其中前两列是整数,而第三列是postgres中的bigint数组,所以它看起来像:

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}"

如何在HANA(SPS 12)中上载数组列?感谢您的帮助.

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

推荐答案

之前在SO上对此进行了讨论.使用ARRAY()函数是将ARRAY插入数组类型的列的 only 方法.

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.

如果要从文件加载数组数据,则必须使用一个自定义加载程序,该程序为每个记录构造ARRAY(....)函数调用.

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.

这篇关于在HANA中上传阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆