Package org.apache.druid.catalog.model
Class CatalogUtils
java.lang.Object
org.apache.druid.catalog.model.CatalogUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GranularityasDruidGranularity(String value) Convert a catalog granularity string to the Druid form.columnNames(List<ColumnSpec> columns) static <T> List<T>concatLists(List<T> base, List<T> additions) static intfindColumn(List<ColumnSpec> columns, String colName) static longstatic StringgetNonBlankString(Map<String, Object> args, String parameter) Get a string parameter that can either be null or non-blank.static StringgetStringArray(Map<String, Object> map, String key) Get the value of aVARCHAR ARRAYparameter.getStringList(Map<String, Object> map, String key) getUriListArg(Map<String, Object> args, String parameter) mergeProperties(Map<String, ModelProperties.PropertyDefn<?>> properties, Map<String, Object> source, Map<String, Object> update) Merge the properties for an object using a set of updates in a map.static <T> Tstatic <T> Tstatic StringstringListToLines(List<String> lines) stringListToUriList(List<String> list) Convert a list of strings to a list ofURIobjects.stringToList(String value) String-to-List<String>conversion.stringToUriList(String uris) static StringCatalog-specific quick & easy implementation oftoString()for objects which are primarily representations of JSON objects.static voidvalidateGranularity(String value)
-
Constructor Details
-
CatalogUtils
public CatalogUtils()
-
-
Method Details
-
columnNames
-
asDruidGranularity
Convert a catalog granularity string to the Druid form. Catalog granularities are either the usual descriptive strings (in any case), or an ISO period. For the odd interval, the interval name is also accepted (for the other intervals, the interval name is the descriptive string). -
stringToList
String-to-List<String>conversion. The string can contain zero items, one items, or a list. The list items are separated by a comma and optional whitespace. -
safeCast
-
safeGet
-
getLong
-
getString
-
getStringList
-
getStringArray
Get the value of aVARCHAR ARRAYparameter. Though the type is calledARRAY, Calcite provides the actual value as aListofStrings. -
stringListToLines
-
toString
Catalog-specific quick & easy implementation oftoString()for objects which are primarily representations of JSON objects. Use only for cases where thetoString()is for debugging. Also, assumes that the type can serialized using the default mapper: this trick doesn't work for types that require custom Jackson extensions. The catalog, however, has a simple type hierarchy, which is not extended via extensions, and so the default object mapper is fine. -
concatLists
-
getNonBlankString
Get a string parameter that can either be null or non-blank. -
getUriListArg
-
stringToUriList
-
stringListToUriList
Convert a list of strings to a list ofURIobjects. -
mergeProperties
public static Map<String,Object> mergeProperties(Map<String, ModelProperties.PropertyDefn<?>> properties, Map<String, Object> source, Map<String, Object> update) Merge the properties for an object using a set of updates in a map. If the update value isnull, then remove the property in the revised set. If the property is known, use the column definition to merge the values. Else, the update replaces any existing value.This method does not validate the properties, except as needed to do a merge. A separate validation step is done on the final, merged object.
-
validateGranularity
-
findColumn
-