16 #ifndef IMPALA_EXEC_HDFS_AVRO_SCANNER_H
17 #define IMPALA_EXEC_HDFS_AVRO_SCANNER_H
70 #include <avro/basics.h>
90 const std::vector<ExprContext*>& conjunct_ctxs);
101 return THdfsFileFormat::AVRO;
209 RuntimeState* state, llvm::Function* materialize_tuple_fn,
210 const std::vector<ExprContext*>& conjunct_ctxs);
238 PrimitiveType type,
int max_len, uint8_t** data,
bool write_slot,
void* slot,
241 PrimitiveType type,
int max_len, uint8_t** data,
bool write_slot,
void* slot,
252 int slot_byte_size, uint8_t** data,
bool write_slot,
void* slot,
MemPool*
pool);
262 #endif // IMPALA_EXEC_HDFS_AVRO_SCANNER_H
int(* DecodeAvroDataFn)(HdfsAvroScanner *, int, MemPool *, uint8_t **, Tuple *, TupleRow *)
virtual Status ProcessRange()
void ReadAvroVarchar(PrimitiveType type, int max_len, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
ScopedAvroSchemaT(avro_schema_t s=NULL)
virtual Status ReadFileHeader()
TODO: check that file schema matches metadata schema.
ScopedAvroSchemaT & operator=(const ScopedAvroSchemaT &)
static const std::string AVRO_SNAPPY_CODEC
struct avro_obj_t * avro_schema_t
A tuple with 0 materialised slots is represented as NULL.
void ReadAvroBoolean(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static SchemaElement ConvertSchema(const avro_schema_t &schema)
Utility function that maps the Avro library's type representation to our own.
virtual FileHeader * AllocateFileHeader()
Implementation of BaseSeqeunceScanner super class methods.
avro_schema_t operator->() const
Status VerifyTypesMatch(SlotDescriptor *slot_desc, avro_obj_t *schema)
Status ParseMetadata()
Utility function for decoding and parsing file header metadata.
LLVM code generator. This is the top level object to generate jitted code.
void ReadAvroDecimal(int slot_byte_size, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
void MaterializeTuple(MemPool *pool, uint8_t **data, Tuple *tuple)
Materializes a single tuple from serialized record data.
static llvm::Function * CodegenMaterializeTuple(HdfsScanNode *node, LlvmCodeGen *codegen)
std::vector< SchemaElement > children
Complex types, e.g. records, may have nested child types.
static const uint8_t AVRO_VERSION_HEADER[4]
void ReadAvroDouble(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
int DecodeAvroData(int max_tuples, MemPool *pool, uint8_t **data, Tuple *tuple, TupleRow *tuple_row)
avro_schema_t schema
If not NULL, this owns a reference to schema.
Wrapper for avro_schema_t's that handles decrementing the ref count.
virtual Status InitNewRange()
Reset internal state for a new scan range.
void ReadAvroChar(PrimitiveType type, int max_len, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static const std::string AVRO_SCHEMA_KEY
Metadata keys.
const SlotDescriptor * slot_desc
void ReadAvroFloat(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static const char * LLVM_CLASS_NAME
HdfsAvroScanner(HdfsScanNode *scan_node, RuntimeState *state)
void ReadAvroInt64(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
static llvm::Function * Codegen(HdfsScanNode *, const std::vector< ExprContext * > &conjunct_ctxs)
Codegen parsing records, writing tuples and evaluating predicates.
void ReadAvroInt32(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
virtual THdfsFileFormat::type file_format() const
Returns type of scanner: e.g. rcfile, seqfile.
static llvm::Function * CodegenDecodeAvroData(RuntimeState *state, llvm::Function *materialize_tuple_fn, const std::vector< ExprContext * > &conjunct_ctxs)
DecodeAvroDataFn codegend_decode_avro_data_
The codegen'd version of DecodeAvroData() if available, NULL otherwise.
ScopedAvroSchemaT schema
The record field schema from the file.
void ReadAvroString(PrimitiveType type, uint8_t **data, bool write_slot, void *slot, MemPool *pool)
Status ResolveSchemas(const avro_schema_t &table_root, const avro_schema_t &file_root)
static const std::string AVRO_NULL_CODEC
Supported codecs, as they appear in the metadata.
static const std::string AVRO_CODEC_KEY
static const std::string AVRO_DEFLATE_CODEC
AvroFileHeader * avro_header_
bool ReadUnionType(int null_union_position, uint8_t **data)