这篇文章主要介绍了怎么安装并使用SAP HANA Express Edition,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
文中介绍了一个yaml文件,里面声明了容器镜像文件store/saplabs/hanaexpress:2.00.033.00.20180925.2.
安装完成后,在启动的pod里有两个容器,分别运行着SQLPad和HANA Express.
SQLPad是一个基于Nodejs开发的直接在浏览器运行SQL查询并对结果进行可视化展示工具。SQLPad支持的数据库非常多,比如:MySQL, Postgres, SQL Server, Vertica, Crate, Presto等。
使用kubectl get services拿到sqlpad的external IP:
在浏览器里输入刚才获得的IP地址,后面加上默认的3000端口,打开sqlpad的web控制台:
注册一个帐户并登录:
选择admin-Connections:
新建一个数据库连接:
database driver从下拉菜单里选择SAP HANA:
回到Google Cloud Platform的cloud shell,使用kubectl get services获得hxe-connect的external IP:
把这个地址填到数据库创建向导里:
创建一个名为quotes的collection并插入一些数据:
create collection quotes; insert into quotes values ( { "FROM" : 'HOMER', "TO" : 'BART', "QUOTE" : 'I want to share something with you: The three little sentences that will get you through life. Number 1: Cover for me. Number 2: Oh, good idea, Boss! Number 3: It wai like that when I got here.', "MOES_BAR" : 'Point( -86.880306 36.508361 )', "QUOTE_ID" : 1 }); insert into quotes values ( { "EPISODE" : 'GRADE SCHOOL CONFIDENTIAL', "FROM" : 'HOMER', "QUOTE" : 'Wait a minute. Bart''s teacher is named Krabappel? Oh, I''ve been calling her Crandall. Why did not anyone tell me? Ohhh, I have been making an idiot out of myself!', "QUOTE_ID" : 2, "MOES_BAR" : 'Point( 2.161018 41.392641 )' }); insert into quotes values ( { "FROM" : 'HOMER', "QUOTE" : 'Oh no! What have I done? I smashed open my little boy''s piggy bank, and for what? A few measly cents, not even enough to buy one beer. Weit a minute, lemme count and make sure…not even close.', "MOES_BAR" : 'Point( -122.400690 37.784366 )', "QUOTE_ID" : 3 });
注意这个生成的sql collection并不是数据库表,而是一种document store(noSQL),实际上只是键值对-key value pair.
下面的SQL语句执行的操作是把document store里的值取出进行分析,将分析结果存放到新创建的column table里:
--Create a columnar table with a text fuzzy search index create column table quote_analysis ( id integer, homer_quote text FAST PREPROCESS ON FUZZY SEARCH INDEX ON, lon_lat nvarchar(200) ); -- Copy the quotes form the JSON store to the relational table insert into quote_analysis with doc_store as (select quote_id, quote from quotes) select doc_store.quote_id as id, doc_store.quote as homer_quote, 'Point( 2.151255 41.354159 )' from doc_store;
感谢你能够认真阅读完这篇文章,希望小编分享的“怎么安装并使用SAP HANA Express Edition”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。