package json
- Alphabetic
- Public
- All
Type Members
-
class
JacksonParser extends Logging
Constructs a parser for a given schema that translates a json string to an InternalRow.
-
class
JsonFilters extends StructFilters
The class provides API for applying pushed down source filters to rows with a struct schema parsed from JSON records.
The class provides API for applying pushed down source filters to rows with a struct schema parsed from JSON records. The class should be used in this way: 1. Before processing of the next row,
JacksonParser(parser for short) resets the internal state ofJsonFiltersby calling thereset()method. 2. The parser reads JSON fields one-by-one in streaming fashion. It converts an incoming field value to the desired type from the schema. After that, it sets the value to an instance ofInternalRowat the position according to the schema. Order of parsed JSON fields can be different from the order in the schema. 3. Per every JSON field of the top-level JSON object, the parser callsskipRowby passing anInternalRowin which some of fields can be already set, and the position of the JSON field according to the schema. 3.1skipRowfinds a group of predicates that refers to this JSON field. 3.2 Per each predicate from the group,skipRowdecrements its reference counter. 3.2.1 If predicate reference counter becomes 0, it means that all predicate attributes have been already set in the internal row, and the predicate can be applied to it.skipRowinvokes the predicate for the row. 3.3skipRowapplies predicates until one of them returnsfalse. In that case, the method returnstrueto the parser. 3.4 If all predicates with zero reference counter returntrue, the final result of the method isfalsewhich tells the parser to not skip the row. 4. If the parser getstruefromJsonFilters.skipRow, it must not call the method anymore for this internal row, and should go the step 1.Besides of
StructFiltersassumptions,JsonFiltersassumes that:skipRow()can be called for any valid index of the struct fields, and in any order.- After
skipRow()returnstrue, the internal state ofJsonFilterscan be inconsistent, so,skipRow()must not be called for the current row anymore withoutreset().
Value Members
- object JacksonUtils
- object JsonInferSchema extends Serializable