investigate/convert to Calcite's SchemaPlus way of reading calcite models instea...
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/calcite/utils/ModelParser.java and the referenced model.json resource. Investigate Calcite's SchemaPlus model-reading approach and compare it with the current ObjectMapper-based parsing and configuration path. Done means the parser uses the SchemaPlus approach instead of manually handling JSON, with the existing model sources still supported.
Written by the indexing model from the issue text.
Description
investigate/convert to Calcite's SchemaPlus way of reading calcite models instead of manually handling JSON
package org.apache.wayang.api.sql.calcite.utils;
import org.apache.wayang.core.api.Configuration;
import org.json.simple.parser.ParseException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Iterator;
import java.util.Objects;
/*
* TODO: investigate/convert to Calcite's SchemaPlus way of reading calcite models instead of manually handling JSON
*/
public class ModelParser {
private final Configuration configuration;
private final JsonNode json;
public ModelParser() throws IOException, ParseException {
final String jsonString = Files
.readString(new File("wayang-api/wayang-api-sql/src/main/resources/model.json").toPath());
final ObjectMapper objectMapper = new ObjectMapper();
this.json = objectMapper.readTree(jsonString);
this.configuration = null;
}
public ModelParser(final Configuration configuration) throws IOException, ParseException {
final String calciteModel = "{\"calcite\":" + configuration.getStringProperty("wayang.calcite.model")
+ ",\"separator\":\";\"}";
final ObjectMapper objectMapper = new ObjectMapper();
this.json = objectMapper.readTree(calciteModel);
this.configuration = configuration;
}
/**
42ae52181df51b4758af79cc1688e807c1e634b0
- Dominant language
- Java
- Stars
- 274
- Forks
- 141
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/wayang
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
[Docs] Fix broken markdown formatting, leaked reviewer prompt, and outdated URLs in tutorial.md Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
convert to config Opentodo
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100