Package org.apache.parquet.io
Class ValidatingRecordConsumer
- java.lang.Object
-
- org.apache.parquet.io.api.RecordConsumer
-
- org.apache.parquet.io.ValidatingRecordConsumer
-
public class ValidatingRecordConsumer extends RecordConsumer
Wraps a record consumer Validates the record written against the schema and pass down the event to the wrapped consumer
-
-
Constructor Summary
Constructors Constructor Description ValidatingRecordConsumer(RecordConsumer delegate, MessageType schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBinary(Binary value)
add a binary value in the current fieldvoid
addBoolean(boolean value)
add a boolean value in the current fieldvoid
addDouble(double value)
add a double value in the current fieldvoid
addFloat(float value)
add a float value in the current fieldvoid
addInteger(int value)
add an int value in the current fieldvoid
addLong(long value)
add a long value in the current fieldvoid
endField(String field, int index)
end of a field in a group or messagevoid
endGroup()
end of a group in a fieldvoid
endMessage()
end of a recordvoid
flush()
NoOps by default Subclass class can implement its own flushing logicvoid
startField(String field, int index)
start of a field in a group or message if the field is repeated the field is started only once and all values added in between start and endvoid
startGroup()
start of a group in a fieldvoid
startMessage()
start a new record
-
-
-
Constructor Detail
-
ValidatingRecordConsumer
public ValidatingRecordConsumer(RecordConsumer delegate, MessageType schema)
- Parameters:
delegate
- the consumer to pass down the event toschema
- the schema to validate against
-
-
Method Detail
-
startMessage
public void startMessage()
start a new record- Specified by:
startMessage
in classRecordConsumer
-
endMessage
public void endMessage()
end of a record- Specified by:
endMessage
in classRecordConsumer
-
startField
public void startField(String field, int index)
start of a field in a group or message if the field is repeated the field is started only once and all values added in between start and end- Specified by:
startField
in classRecordConsumer
- Parameters:
field
- name of the fieldindex
- of the field in the group or message
-
endField
public void endField(String field, int index)
end of a field in a group or message- Specified by:
endField
in classRecordConsumer
- Parameters:
field
- name of the fieldindex
- of the field in the group or message
-
startGroup
public void startGroup()
start of a group in a field- Specified by:
startGroup
in classRecordConsumer
-
endGroup
public void endGroup()
end of a group in a field- Specified by:
endGroup
in classRecordConsumer
-
flush
public void flush()
NoOps by default Subclass class can implement its own flushing logic- Overrides:
flush
in classRecordConsumer
-
addInteger
public void addInteger(int value)
add an int value in the current field- Specified by:
addInteger
in classRecordConsumer
- Parameters:
value
- an int value
-
addLong
public void addLong(long value)
add a long value in the current field- Specified by:
addLong
in classRecordConsumer
- Parameters:
value
- a long value
-
addBoolean
public void addBoolean(boolean value)
add a boolean value in the current field- Specified by:
addBoolean
in classRecordConsumer
- Parameters:
value
- a boolean value
-
addBinary
public void addBinary(Binary value)
add a binary value in the current field- Specified by:
addBinary
in classRecordConsumer
- Parameters:
value
- a binary value
-
addFloat
public void addFloat(float value)
add a float value in the current field- Specified by:
addFloat
in classRecordConsumer
- Parameters:
value
- a float value
-
addDouble
public void addDouble(double value)
add a double value in the current field- Specified by:
addDouble
in classRecordConsumer
- Parameters:
value
- a double value
-
-