Class ParquetParserSession
- All Implemented Interfaces:
BeanSession,ConverterSession,ArrayRecordReadable,RecordReadable
ParquetParser.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for parser sessions.Nested classes/interfaces inherited from class org.apache.juneau.marshall.parser.InputStreamParserSession
InputStreamParserSession.DefaultBuilder -
Field Summary
Fields inherited from class org.apache.juneau.marshall.parser.ParserSession
DEFAULT_MAX_PARSE_DEPTHFields inherited from class org.apache.juneau.marshall.MarshallingSession
NAME_PROPERTY_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionstatic ParquetParserSession.Buildercreate(ParquetParser ctx) Creates a new session builder.protected <T> TdoRead(ParserPipe pipe, ClassMeta<T> type) Workhorse method.booleanReturns whether this binary parser has a native byte-array wire type.booleanThe Parquet array-record cursor is buffered/RecordAdapter-backed, not O(1) streaming.booleanThe Parquet record cursor is buffered/RecordAdapter-backed, not O(1) streaming.readArrayRecords(Object input) Buffered array-elementRecordReaderfor Parquet, bound to this live session.readRecords(Object input) Opens a whole-value pull-parser cursor over a Parquet document, bound to this live session.static voidsetDebugEnabled(boolean enabled) Enable debug output for schema/column tracing.Methods inherited from class org.apache.juneau.marshall.parser.InputStreamParserSession
create, createPipe, getBinaryFormat, isReaderParserMethods inherited from class org.apache.juneau.marshall.parser.ParserSession
allocateLocal, cast, checkRequired, convertAttrToType, create, doReadIntoCollection, doReadIntoMap, doReadToBeanConsumer, enterParseDepth, exitParseDepth, getCalendarFormat, getClassMeta, getDateFormat, getDebugOutputLines, getDurationFormat, getInputAsString, getJavaMethod, getLastLocation, getListener, getListener, getListenerClass, getLocaleFormat, getNulls, getOuter, getPeriodFormat, getPosition, getSchema, getStringBuilder, getTemporalFormat, getTimeZoneFormat, isAutoCloseStreams, isTrimStrings, isUnbuffered, mark, onBeanSetterException, onUnknownProperty, parentBean, properties, read, read, read, read, read, read, readArgs, readCalendar, readDate, readDuration, readIntoCollection, readIntoMap, readPeriod, readTemporal, readToBeanConsumer, returnStringBuilder, setCurrentClass, setCurrentProperty, setName, setParent, setPipe, swapParentBean, trim, trim, unmark, unswapMethods inherited from class org.apache.juneau.marshall.MarshallingSession
addWarning, convertToMemberType, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, convertToType, create, get, getActiveView, getAnnotationProvider, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassLoader, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMarshallingContext, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isPropertyInActiveView, isRecordComponentOrder, isUnsortedProperties, isUseInterfaceProxies, isUseJavaBeanIntrospector, isValidateSchema, newBean, newBean, newBeanMap, newBeanMap, newGenericList, newGenericMap, newGenericMap, object, parseToList, parseToMap, string, toArray, toBeanMap, toBeanMap, toBeanMapMethods inherited from class org.apache.juneau.marshall.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.marshall.stream.ArrayRecordReadable
readArrayRecordsMethods inherited from interface org.apache.juneau.commons.conversion.ConverterSession
get
-
Constructor Details
-
ParquetParserSession
-
-
Method Details
-
setDebugEnabled
Enable debug output for schema/column tracing.- Parameters:
enabled-true to enable debug logging to temp file.
-
create
Creates a new session builder.- Parameters:
ctx- The parser context.
Cannot benull .- Returns:
- A new builder.
-
readRecords
Opens a whole-value pull-parser cursor over a Parquet document, bound to this live session.read(...)delegates to the polymorphicParserSession.read(Object, Class)entry point.- Specified by:
readRecordsin interfaceRecordReadable- Parameters:
input- The input.- Returns:
- A new
RecordReadercursor. - Throws:
IOException- If a problem occurred opening the underlying input.
-
readArrayRecords
Buffered array-elementRecordReaderfor Parquet, bound to this live session. Callsparse(input, List.class, Object.class)once and iterates the result.Why this stays buffered (not O(1) streaming):
Although a Parquet file is logically row-shaped, it is not a forward, element-at-a-time wire format. Its metadata footer (schema + row-group/column-chunk offsets) lives at the end of the file, so a reader must seek to the tail before it can interpret any row, and values are stored column-major — reconstructing one logical record requires reading one page from every column chunk. Both properties force whole-file (or at minimum whole-row-group) buffering; a true O(1)-in-rows cursor is not achievable over the current single-row-group in-memory decoder. Left buffered by design.
- Specified by:
readArrayRecordsin interfaceArrayRecordReadable- Parameters:
input- The input.- Returns:
- A buffered
RecordReader. - Throws:
IOException- If a problem occurred reading the input.
-
isRecordStreaming
The Parquet record cursor is buffered/RecordAdapter-backed, not O(1) streaming.- Specified by:
isRecordStreamingin interfaceRecordReadable- Returns:
- Always
false .
-
isArrayRecordStreaming
The Parquet array-record cursor is buffered/RecordAdapter-backed, not O(1) streaming.Parquet's end-of-file metadata footer and column-major value layout require whole-file buffering before any record can be reconstructed, so genuine element-at-a-time streaming is not feasible here; see
readArrayRecords(Object)for the full rationale.- Specified by:
isArrayRecordStreamingin interfaceArrayRecordReadable- Returns:
- Always
false .
-
hasNativeBytes
Description copied from class:InputStreamParserSessionReturns whether this binary parser has a native byte-array wire type.Mirror of
OutputStreamSerializerSession.hasNativeBytes()for the parse side. Whentrue,byte[]payloads are consumed natively from the binary stream (e.g. MsgPackbinfamily, CBOR byte-string major type 2, BSON binary subtype0x05) andBinarySwapskips so the raw bytes reach the bean property directly. Whenfalsethe parser surfacesbyte[]payloads as a string (UTF-8 column for Parquet, plain literal for binary RDF) andBinarySwapfires to apply the configuredBinaryFormatreverse decoding back tobyte[].Defaults to
true. Subclasses without a native byte-array wire type (e.g.ParquetParserSessionand the binary RDF parser sessions) override and returnfalse.- Overrides:
hasNativeBytesin classInputStreamParserSession- Returns:
trueif this parser has a native byte-array wire type.
-
doRead
Description copied from class:ParserSessionWorkhorse method.Subclasses are expected to implement this method or
Parser.doRead(ParserSession,ParserPipe,ClassMeta).The default implementation of this method simply calls
Parser.doRead(ParserSession,ParserPipe,ClassMeta).- Overrides:
doReadin classParserSession- Type Parameters:
T- The class type of the object to create.- Parameters:
pipe- Where to get the input from.type- The class type of the object to create. Ifnull orObject., object type is based on what's being parsed. For example, when parsing JSON text, it may return aclass String ,Number ,JsonMap , etc...- Returns:
- The parsed object.
- Throws:
IOException- Thrown by underlying stream.ParseException- Malformed input encountered.
-