1、环境搭建
2、执行如下命令
java -classpath /home/carbondata/carbondata/assembly/target/scala-2.11/apache-carbondata-1.6.0-SNAPSHOT-bin-spark2.2.1-hadoop2.7.2.jar:/home/carbondata/carbondata/examples/spark2/target/carbondata-examples-1.6.0-SNAPSHOT.jar:/home/carbondata/hadoop-2.7.2/share/hadoop/tools/lib/:/home/carbondata/hadoop-2.7.2/share/hadoop/common/:/home/carbondata/hadoop-2.7.2/share/hadoop/mapreduce/* org.apache.carbondata.examples.sdk.SDKS3Example <access-key> <secret-key> <s3-endpoint> <table-path-on-s3>
其中access-key,secret-key,s3-endpoint,table-path-on-s3为CarbonData oss bucket管理中提到的4个基本要素
/home/carbondata为用户目录,carbondata和hadoop都安装在用户目录下。
3、查看oss写是否成功
4、查看oss读是否成功
图中显示9条数据被正确读取。