Class ParserUtils
java.lang.Object
org.apache.druid.java.util.common.parsers.ParserUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateFieldNames(int length) static org.joda.time.DateTimeZonegetDateTimeZone(String timeZone) static StringgetDefaultColumnName(int ordinal) Return a function to generate default column names.getTransformationFunction(String listDelimiter, com.google.common.base.Splitter listSplitter, boolean tryParseNumbers) static StringstripQuotes(String input) static voidvalidateFields(Iterable<String> fieldNames)
-
Constructor Details
-
ParserUtils
public ParserUtils()
-
-
Method Details
-
getTransformationFunction
public static com.google.common.base.Function<String,Object> getTransformationFunction(String listDelimiter, com.google.common.base.Splitter listSplitter, boolean tryParseNumbers) - Returns:
- a transformation function on an input value. The function performs the following transformations on the input string:
- Splits it into multiple values using the
listSplitterif thelist delimiteris present in the input.- If
tryParseNumbersis true, the function will also attempt to parse any numeric values present in the input: integers asLongand floating-point numbers asDouble. If the input is not a number or parsing fails, the input is returned as-is as a string. - Splits it into multiple values using the
-
generateFieldNames
-
validateFields
-
stripQuotes
-
getDateTimeZone
-
getDefaultColumnName
Return a function to generate default column names. Note that the postfix for default column names starts from 1.- Returns:
- column name generating function
-