Read Parquet file from S3 without hadoop

0

I need to read a parquet file from S3 using Java in a maven project. I am using the below code to read the Parquet file, but the serverless app I am deploying exceeds the limit of 50Mb when I include the parquet and Hadoop dependencies. I need Hadoop Path and Configuration classes to read the file on S3. Is there any way I can avoid Hadoop altogether?

List<SimpleGroup> simpleGroups = new ArrayList<>(); ParquetFileReader reader = ParquetFileReader.open(HadoopInputFile.fromPath(new Path(filePath), conf)); MessageType schema = reader.getFooter().getFileMetaData().getSchema(); List<Type> fields = schema.getFields(); PageReadStore pages; while ((pages = reader.readNextRowGroup()) != null) { long rows = pages.getRowCount(); MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema); RecordReader recordReader = columnIO.getRecordReader(pages, new GroupRecordConverter(schema)); for (int i = 0; i < rows; i++) { SimpleGroup simpleGroup = (SimpleGroup) recordReader.read(); simpleGroups.add(simpleGroup); } } reader.close();

AWS
preguntada hace 4 años2672 visualizaciones
1 Respuesta
1
Respuesta aceptada

Have you tried S3 select? This will avoid Hadoop altogether. Also take a look at example to search data using S3 select with simple sql queries.

AWS
Vivek_S
respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas