Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new api to upload csv, table.yaml, and query into HDFS #48

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

NLGithubWP
Copy link
Collaborator

@NLGithubWP NLGithubWP commented May 29, 2022

  1. Enable provide .dz file name in the loading process.
  2. Add distributed APIs to enable users to load local CSV and upload it to HDFS.
  3. Add distributed APIs to enable users to upload queries.json files, store them locally, and upload them into HDFS.
  4. Add comments.
  5. Add Client Package to send reqeust.
  6. docs is at Add distributed APIs into doc COOL-site#23

@KimballCai KimballCai added the enhancement New feature or request label May 31, 2022
@KimballCai KimballCai changed the base branch from main to dev June 20, 2022 06:01
Copy link
Contributor

@KimballCai KimballCai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to change many things

@@ -9,7 +9,7 @@
public class CliDataWriter implements DataWriter {

@Override
public boolean Initialize() throws IOException {
public boolean Initialize(String... fileName) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use String[] instead of the String...

@@ -137,8 +137,15 @@ private void finishCublet() throws IOException {
* @return DataOutputStream
* @throws IOException
*/
private DataOutputStream newCublet() throws IOException {
String fileName = Long.toHexString(System.currentTimeMillis()) + ".dz";
private DataOutputStream newCublet(String... fileNameParams) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to give a file name?

@@ -33,6 +33,10 @@ public class LoadQuery {
private String outputPath;
private String configPath;

// after writing dz, table file, records the path inside the server.
private String dzFilePath;
private String TableFilePath;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TableFilePath should be the same as the schemaPath.

@@ -33,6 +33,10 @@ public class LoadQuery {
private String outputPath;
private String configPath;

// after writing dz, table file, records the path inside the server.
private String dzFilePath;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the dzFilePath?

* @param dataSourceName output cube name. Need to be specified when loading from the repository, eg, sogamo
* @param schemaFileName path to the table.yaml, eg. sogamo/table.yaml
* @param dataFileName path to the data.csv, eg. sogamo/test.csv
* @param cubeRepo the name of the output cube repository. eg. datasetSource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs a @param for fileName

public static void main(String[] args) throws Exception {

if (args.length != 1) {
System.err.println("Pass in query id (Example: q1)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard coding.

HDFSConnection fs = HDFSConnection.getInstance();

String localPath1 = req.getOutputPath() + "/" + req.getDzFilePath();;
String dfsPath1 = "/cube/" + req.getDzFilePath();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cube path is for ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants