xubo245 commented on a change in pull request #3194: [CARBONDATA-3363] SDK supports read carbon data by given file lists, file or folder
URL:
https://github.com/apache/carbondata/pull/3194#discussion_r285632157
##########
File path: examples/spark2/src/main/java/org/apache/carbondata/examples/sdk/SDKS3ReadExample.java
##########
@@ -35,60 +39,69 @@
* Example for testing carbonReader on S3
*/
public class SDKS3ReadExample {
- public static void main(String[] args) throws Exception {
- Logger logger = LogServiceFactory.getLogService(SDKS3ReadExample.class.getName());
- if (args == null || args.length < 3) {
- logger.error("Usage: java CarbonS3Example: <access-key> <secret-key>"
- + "<s3-endpoint> [table-path-on-s3]");
- System.exit(0);
- }
+ public static void main(String[] args) throws Exception {
+ Logger logger = LogServiceFactory.getLogService(SDKS3ReadExample.class.getName());
+ if (args == null || args.length < 3) {
+ logger.error("Usage: java CarbonS3Example: <access-key> <secret-key>"
+ + "<s3-endpoint> [table-path-on-s3]");
+ System.exit(0);
+ }
+
+ String path = "s3a://sdk/WriterOutput/carbondata5";
+ if (args.length > 3) {
+ path = args[3];
+ }
+
+ // 1. read with file list
+ Configuration conf = new Configuration();
- String path = "s3a://sdk/WriterOutput/carbondata5";
- if (args.length > 3) {
- path=args[3];
- }
+ conf.set(ACCESS_KEY, args[0]);
+ conf.set(SECRET_KEY, args[1]);
+ conf.set(ENDPOINT, args[2]);
+ List fileLists = listFiles(path, CarbonTablePath.CARBON_DATA_EXT, conf);
- // Read data
- EqualToExpression equalToExpression = new EqualToExpression(
- new ColumnExpression("name", DataTypes.STRING),
- new LiteralExpression("robot1", DataTypes.STRING));
+ // Read data
Review comment:
code style is not correct.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services