org.nlpcn.es4sql.domain.hints.HintFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-sql Show documentation
Show all versions of elasticsearch-sql Show documentation
Query elasticsearch using SQL
package org.nlpcn.es4sql.domain.hints;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLParser;
import org.elasticsearch.common.xcontent.yaml.YamlXContentParser;
import org.nlpcn.es4sql.exception.SqlParseException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by Eliran on 5/9/2015.
*/
public class HintFactory {
public static Hint getHintFromString(String hintAsString) throws SqlParseException {
if(hintAsString.startsWith("! USE_NESTED_LOOPS") || hintAsString.startsWith("! USE_NL")){
return new Hint(HintType.USE_NESTED_LOOPS,null);
}
if(hintAsString.startsWith("! SHARD_SIZE")){
String[] numbers = getParamsFromHint(hintAsString, "! SHARD_SIZE");
//todo: check if numbers etc..
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy