API数据源示例
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
789 B

# API数据源使用示例
2 years ago
## 调用示例代码
```java
Authentication authentication = new Authentication("#key", "#secret");
DatasourceOperation operation = new DatasourceOperation(authentication);
operation.open();
// 创建一个分组,如果已经存在,则直接跳过
operation.createGroup("TestGroup");
// 在分组下创建一个表,返回创建的表的ID,如果表已经存在,则直接返回表ID
String tableId = operation.createTable("HelloTable", "TestGroup");
// 获取上传文件的url
String fileUploadUrl = operation.requestUploadUrl(tableId);
// 将数据文件上传
HttpKits.upload(fileUploadUrl, new File(System.getProperty("user.dir") + "/data/地区数据分析.csv"));
// 标记该表的数据已经上传完成
operation.markAsFinish(tableId);
```