This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 491144738d NIFI-14615 Added Parquet Content Viewer (#10013)
491144738d is described below
commit 491144738dec8716b6e2aa95fa889be37579884f
Author: Freedom9339 <[email protected]>
AuthorDate: Sat Oct 11 15:50:19 2025 -0500
NIFI-14615 Added Parquet Content Viewer (#10013)
- Moved shared classes to `nifi-parquet-shared`
- Reduced size of `nifi-parquet-nar` with provided scope for Hadoop
libraries
Co-authored-by: David Handermann <[email protected]>
Signed-off-by: David Handermann <[email protected]>
---
.../nifi-parquet-content-viewer/pom.xml | 158 +++++++++++++++
.../viewer/ParquetServletContextListener.java | 71 +++++++
.../controller/ParquetContentViewerController.java | 192 +++++++++++++++++++
.../src/main/resources/META-INF/LICENSE | 212 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE | 42 ++++
.../src/main/webapp/META-INF/nifi-content-viewer | 15 ++
.../nifi-parquet-bundle/nifi-parquet-nar/pom.xml | 6 +
.../nifi-parquet-processors/pom.xml | 21 +-
.../nifi/parquet/record/ParquetRecordReader.java | 2 +-
.../parquet/CalculateParquetOffsets.java | 2 +-
.../parquet/CalculateParquetRowGroupOffsets.java | 2 +-
.../pom.xml | 24 +--
.../nifi/parquet/shared}/NifiParquetInputFile.java | 2 +-
.../parquet/shared}/NifiSeekableInputStream.java | 2 +-
nifi-extension-bundles/nifi-parquet-bundle/pom.xml | 42 ++++
15 files changed, 759 insertions(+), 34 deletions(-)
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/pom.xml
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/pom.xml
new file mode 100644
index 0000000000..0d5fe96b02
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/pom.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-parquet-bundle</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>nifi-parquet-content-viewer</artifactId>
+ <packaging>war</packaging>
+ <properties>
+ <source.skip>true</source.skip>
+
<standard-content-viewer.ui.working.dir>${project.build.directory}/standard-content-viewer-ui-working-directory</standard-content-viewer.ui.working.dir>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-framework-api</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <scope>provided</scope> <!-- expected to be provided by parent
classloader -->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-content-viewer-utils</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-web-servlet-shared</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-frontend</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.parquet</groupId>
+ <artifactId>parquet-common</artifactId>
+ <version>${parquet.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.parquet</groupId>
+ <artifactId>parquet-hadoop</artifactId>
+ <version>${parquet.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.parquet</groupId>
+ <artifactId>parquet-avro</artifactId>
+ <version>${parquet.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-reload4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-parquet-shared</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <!--
+ Unpack the built standard content viewer front end application
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-standard-content-viewer-ui</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeGroupIds>org.apache.nifi</includeGroupIds>
+
<includeArtifactIds>nifi-frontend</includeArtifactIds>
+ <excludeTransitive>true</excludeTransitive>
+ <silent>false</silent>
+
<outputDirectory>${standard-content-viewer.ui.working.dir}</outputDirectory>
+ <includes>standard-content-viewer/**/*</includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ Include the Standard Content Viewer UI and exclude the JAR
dependency
+ -->
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+
<directory>${standard-content-viewer.ui.working.dir}/standard-content-viewer</directory>
+ <includes>**/*</includes>
+ <targetPath>WEB-INF/classes/static</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/webapp/META-INF</directory>
+ <targetPath>META-INF</targetPath>
+ <includes>
+ <include>nifi-content-viewer</include>
+ </includes>
+ <filtering>false</filtering>
+ </resource>
+ </webResources>
+
<packagingExcludes>WEB-INF/lib/nifi-frontend*.jar</packagingExcludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/content/viewer/ParquetServletContextListener.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/content/viewer/ParquetServletContextListener.java
new file mode 100644
index 0000000000..18e9147066
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/content/viewer/ParquetServletContextListener.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.parquet.web.content.viewer;
+
+import jakarta.servlet.DispatcherType;
+import jakarta.servlet.FilterRegistration;
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.ServletContextEvent;
+import jakarta.servlet.ServletContextListener;
+import jakarta.servlet.ServletRegistration;
+import jakarta.servlet.annotation.WebListener;
+import org.apache.nifi.web.servlet.filter.QueryStringToFragmentFilter;
+import org.apache.nifi.parquet.web.controller.ParquetContentViewerController;
+import org.eclipse.jetty.ee11.servlet.DefaultServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.EnumSet;
+
+/**
+ * Servlet Context Listener supporting registration of Filters
+ */
+@WebListener
+public class ParquetServletContextListener implements ServletContextListener {
+ private static final String API_CONTENT_MAPPING = "/api/content";
+
+ private static final int LOAD_ON_STARTUP_ENABLED = 1;
+
+ private static final String DIR_ALLOWED_PARAMETER = "dirAllowed";
+
+ private static final String BASE_RESOURCE_PARAMETER = "baseResource";
+
+ private static final String BASE_RESOURCE_DIRECTORY =
"WEB-INF/classes/static";
+
+ private static final String DEFAULT_MAPPING = "/";
+
+ private static final Logger logger =
LoggerFactory.getLogger(ParquetServletContextListener.class);
+
+ @Override
+ public void contextInitialized(final ServletContextEvent sce) {
+ final ServletContext servletContext = sce.getServletContext();
+ final FilterRegistration.Dynamic filter =
servletContext.addFilter(QueryStringToFragmentFilter.class.getSimpleName(),
QueryStringToFragmentFilter.class);
+ filter.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),
false, DEFAULT_MAPPING);
+
+ final ServletRegistration.Dynamic servlet =
servletContext.addServlet(ParquetContentViewerController.class.getSimpleName(),
ParquetContentViewerController.class);
+ servlet.addMapping(API_CONTENT_MAPPING);
+ servlet.setLoadOnStartup(LOAD_ON_STARTUP_ENABLED);
+
+ final ServletRegistration.Dynamic defaultServlet =
servletContext.addServlet(DefaultServlet.class.getSimpleName(),
DefaultServlet.class);
+ defaultServlet.addMapping(DEFAULT_MAPPING);
+ defaultServlet.setInitParameter(DIR_ALLOWED_PARAMETER,
Boolean.FALSE.toString());
+ defaultServlet.setInitParameter(BASE_RESOURCE_PARAMETER,
BASE_RESOURCE_DIRECTORY);
+ defaultServlet.setLoadOnStartup(LOAD_ON_STARTUP_ENABLED);
+
+ logger.info("Parquet Content Viewer Initialized");
+ }
+}
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/controller/ParquetContentViewerController.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/controller/ParquetContentViewerController.java
new file mode 100644
index 0000000000..79b647d52d
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/java/org/apache/nifi/parquet/web/controller/ParquetContentViewerController.java
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.parquet.web.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.nifi.authorization.AccessDeniedException;
+import org.apache.nifi.web.ContentAccess;
+import org.apache.nifi.web.ContentRequestContext;
+import org.apache.nifi.web.DownloadableContent;
+import org.apache.nifi.web.HttpServletContentRequestContext;
+import org.apache.nifi.web.ResourceNotFoundException;
+import org.apache.parquet.avro.AvroParquetReader;
+import org.apache.parquet.hadoop.ParquetReader;
+import org.apache.parquet.io.InputFile;
+import org.apache.nifi.parquet.shared.NifiParquetInputFile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ParquetContentViewerController extends HttpServlet {
+ private static final Logger logger =
LoggerFactory.getLogger(ParquetContentViewerController.class);
+ private static final ObjectMapper mapper = new ObjectMapper();
+ private static final long MAX_CONTENT_SIZE = 1024 * 1024 * 2; // 10MB
+ private static final int BUFFER_SIZE = 8 * 1024; // 8KB
+
+ private static final byte NEWLINE = '\n';
+ private static final byte COMMA = ',';
+ private static final byte START_ARRAY = '[';
+ private static final byte END_ARRAY = ']';
+
+ @Override
+ public void doGet(final HttpServletRequest request, final
HttpServletResponse response) throws IOException {
+ final ContentRequestContext requestContext = new
HttpServletContentRequestContext(request);
+
+ final ServletContext servletContext = request.getServletContext();
+ final ContentAccess contentAccess = (ContentAccess)
servletContext.getAttribute("nifi-content-access");
+ // get the content
+ final DownloadableContent downloadableContent;
+ try {
+ downloadableContent = contentAccess.getContent(requestContext);
+ } catch (final ResourceNotFoundException e) {
+ logger.warn("Content not found", e);
+ response.sendError(HttpURLConnection.HTTP_NOT_FOUND, "Content not
found");
+ return;
+ } catch (final AccessDeniedException e) {
+ logger.warn("Content access denied", e);
+ response.sendError(HttpURLConnection.HTTP_FORBIDDEN, "Content
access denied");
+ return;
+ } catch (final Exception e) {
+ logger.warn("Content retrieval failed", e);
+ response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR, "Content
retrieval failed");
+ return;
+ }
+
+ response.setStatus(HttpServletResponse.SC_OK);
+
+ try {
+ // Convert InputStream to a seekable InputStream
+ final byte[] data =
getInputStreamBytes(downloadableContent.getContent());
+
+ if (data.length == 0) {
+ response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR,
"Content size is too large to display.");
+ return;
+ }
+
+ final Configuration conf = new Configuration();
+
+ // Allow older deprecated schemas
+ conf.setBoolean("parquet.avro.readInt96AsFixed", true);
+
+ final InputFile inputFile = new NifiParquetInputFile(new
ByteArrayInputStream(data), data.length);
+ try (
+ ParquetReader<GenericRecord> reader =
AvroParquetReader.<GenericRecord>builder(inputFile)
+ .withConf(conf)
+ .build();
+ OutputStream outputStream = response.getOutputStream()) {
+ writeRecords(outputStream, reader);
+ }
+ } catch (final Throwable t) {
+ logger.warn("Unable to format FlowFile content", t);
+ response.sendError(HttpURLConnection.HTTP_INTERNAL_ERROR, "Unable
to format FlowFile content");
+ }
+ }
+
+ private void writeRecords(final OutputStream outputStream, final
ParquetReader<GenericRecord> reader) throws IOException {
+ // Format and write out each record
+ GenericRecord record;
+ boolean firstRecord = true;
+ final ObjectWriter objectWriter =
mapper.writerWithDefaultPrettyPrinter();
+
+ outputStream.write(START_ARRAY);
+ outputStream.write(NEWLINE);
+ while ((record = reader.read()) != null) {
+ if (firstRecord) {
+ firstRecord = false;
+ } else {
+ outputStream.write(COMMA);
+ outputStream.write(NEWLINE);
+ }
+
+ final Object mappedRecord = recordToMap(record);
+ final byte[] serializedRecord =
objectWriter.writeValueAsBytes(mappedRecord);
+ outputStream.write(serializedRecord);
+ }
+ outputStream.write(NEWLINE);
+ outputStream.write(END_ARRAY);
+ }
+
+ private static Object recordToMap(final Object obj) {
+ switch (obj) {
+ case GenericRecord record -> {
+ final Map<String, Object> map = new LinkedHashMap<>();
+ for (final Schema.Field field :
record.getSchema().getFields()) {
+ map.put(field.name(),
recordToMap(record.get(field.name())));
+ }
+ return map;
+ }
+ case Collection<?> coll -> {
+ final List<Object> list = new ArrayList<>();
+ for (Object elem : coll) {
+ list.add(recordToMap(elem));
+ }
+ return list;
+ }
+ case GenericData.EnumSymbol enumSymbol -> {
+ return enumSymbol.toString();
+ }
+ case org.apache.avro.util.Utf8 utf8 -> {
+ return utf8.toString();
+ }
+ case null, default -> {
+ return obj;
+ }
+ }
+ }
+
+ private byte[] getInputStreamBytes(final InputStream inputStream) throws
IOException {
+ try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream())
{
+ final byte[] buffer = new byte[BUFFER_SIZE];
+ long totalRead = 0;
+
+ while (totalRead < MAX_CONTENT_SIZE) {
+ int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
+ if (bytesRead == -1) {
+ break;
+ }
+ outputStream.write(buffer, 0, bytesRead);
+ totalRead += bytesRead;
+ }
+
+ // Return empty array if inputStream has more data beyond maxBytes
+ if (totalRead >= MAX_CONTENT_SIZE && inputStream.read() != -1) {
+ return new byte[0];
+ }
+
+ return outputStream.toByteArray();
+ }
+ }
+}
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/LICENSE
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000000..d85e3099c9
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,212 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+APACHE NIFI SUBCOMPONENTS:
+
+The Apache NiFi project contains subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+For the binary distribution of nifi-parquet-content-viewer see its
3rdpartylicenses.txt
+for additional license and notice information.
\ No newline at end of file
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/NOTICE
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..08cd9ad37e
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,42 @@
+nifi-web-docs
+Copyright 2014-2025 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+For the binary distribution of nifi-standard-content-viewer see its
3rdpartylicenses.txt
+for additional license and notice information.
+
+===========================================
+Apache Software License v2
+===========================================
+
+The following binary components are provided under the Apache Software License
v2
+
+ (ASLv2) Apache Avro
+ The following NOTICE information applies:
+ Apache Avro
+ Copyright 2009-2017 The Apache Software Foundation
+
+ (ASLv2) Apache Parquet
+ The following NOTICE information applies:
+ Apache Parquet MR (Incubating)
+ Copyright 2014 The Apache Software Foundation
+
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
+
+ (ASLv2) Apache Commons IO
+ The following NOTICE information applies:
+ Apache Commons IO
+ Copyright 2002-2016 The Apache Software Foundation
+
+Other open source components:
+
+ (CDDL 1.1) (GPL2 w/ CPE) Jakarta Servlet API
+ (CDDL 1.1) (GPL2 w/ CPE) jersey-common
(org.glassfish.jersey.core:jersey-common:jar:3.1.10 - https://jersey.github.io/)
+
+ ## FastDoubleParser
+ jackson-core bundles a shaded copy of FastDoubleParser
<https://github.com/wrandelshofer/FastDoubleParser>.
+ That code is available under an MIT license
<https://github.com/wrandelshofer/FastDoubleParser/blob/main/LICENSE>
+ under the following copyright.
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/webapp/META-INF/nifi-content-viewer
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/webapp/META-INF/nifi-content-viewer
new file mode 100644
index 0000000000..a9205dcf98
--- /dev/null
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-content-viewer/src/main/webapp/META-INF/nifi-content-viewer
@@ -0,0 +1,15 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+parquet=application/vnd.apache.parquet
\ No newline at end of file
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
index 1e57fc353f..9127b832ec 100644
--- a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
+++ b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
@@ -37,5 +37,11 @@
<version>2.7.0-SNAPSHOT</version>
<type>nar</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-parquet-content-viewer</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
</dependencies>
</project>
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml
index 92127042e5..d9b338f95b 100644
--- a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml
+++ b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml
@@ -62,23 +62,10 @@
</exclusion>
</exclusions>
</dependency>
- <!-- Override old nimbus in Hadoop Clients -->
- <dependency>
- <groupId>com.nimbusds</groupId>
- <artifactId>nimbus-jose-jwt</artifactId>
- <version>${nimbus-jose-jwt.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <!-- NOTE: parquet-avro 1.12.0 brings in snappy-java 1.1.8, but
hadoop-libraries depends on an older version so we
- have to exclude it here otherwise it creates incompatible class
errors
- -->
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-avro</artifactId>
- <version>1.16.0</version>
+ <version>${parquet.version}</version>
<exclusions>
<exclusion>
<groupId>org.xerial.snappy</groupId>
@@ -112,11 +99,15 @@
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kerberos-user-service-api</artifactId>
</dependency>
- <!-- Test dependencies -->
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mock-record-utils</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.nifi</groupId>
+ <artifactId>nifi-parquet-shared</artifactId>
+ <version>2.7.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/record/ParquetRecordReader.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/record/ParquetRecordReader.java
index 0ed4680c4b..d0aa17e826 100644
---
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/record/ParquetRecordReader.java
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/record/ParquetRecordReader.java
@@ -25,7 +25,7 @@ import org.apache.avro.generic.GenericRecord;
import org.apache.hadoop.conf.Configuration;
import org.apache.nifi.avro.AvroTypeUtil;
import org.apache.nifi.parquet.filter.OffsetRecordFilter;
-import org.apache.nifi.parquet.stream.NifiParquetInputFile;
+import org.apache.nifi.parquet.shared.NifiParquetInputFile;
import org.apache.nifi.parquet.utils.ParquetAttribute;
import org.apache.nifi.serialization.RecordReader;
import org.apache.nifi.serialization.record.MapRecord;
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetOffsets.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetOffsets.java
index df72e2840c..eab06425ae 100644
---
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetOffsets.java
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetOffsets.java
@@ -35,7 +35,7 @@ import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
-import org.apache.nifi.parquet.stream.NifiParquetInputFile;
+import org.apache.nifi.parquet.shared.NifiParquetInputFile;
import org.apache.nifi.parquet.utils.ParquetAttribute;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetRowGroupOffsets.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetRowGroupOffsets.java
index a89bcfe748..0c693a9349 100644
---
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetRowGroupOffsets.java
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/processors/parquet/CalculateParquetRowGroupOffsets.java
@@ -31,7 +31,7 @@ import
org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.flowfile.FlowFile;
-import org.apache.nifi.parquet.stream.NifiParquetInputFile;
+import org.apache.nifi.parquet.shared.NifiParquetInputFile;
import org.apache.nifi.parquet.utils.ParquetAttribute;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/pom.xml
similarity index 62%
copy from nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
copy to nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/pom.xml
index 1e57fc353f..80858127d0 100644
--- a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-nar/pom.xml
+++ b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/pom.xml
@@ -13,29 +13,25 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
-
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-parquet-bundle</artifactId>
<version>2.7.0-SNAPSHOT</version>
</parent>
- <artifactId>nifi-parquet-nar</artifactId>
- <packaging>nar</packaging>
+ <artifactId>nifi-parquet-shared</artifactId>
<dependencies>
<dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-parquet-processors</artifactId>
- <version>2.7.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.nifi</groupId>
- <artifactId>nifi-hadoop-libraries-nar</artifactId>
- <version>2.7.0-SNAPSHOT</version>
- <type>nar</type>
+ <groupId>org.apache.parquet</groupId>
+ <artifactId>parquet-common</artifactId>
+ <version>${parquet.version}</version>
+ <scope>compile</scope>
</dependency>
</dependencies>
-</project>
+
+</project>
\ No newline at end of file
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiParquetInputFile.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiParquetInputFile.java
similarity index 97%
rename from
nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiParquetInputFile.java
rename to
nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiParquetInputFile.java
index 98e8cf3f75..7224668ac6 100644
---
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiParquetInputFile.java
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiParquetInputFile.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.nifi.parquet.stream;
+package org.apache.nifi.parquet.shared;
import org.apache.nifi.stream.io.ByteCountingInputStream;
import org.apache.parquet.io.InputFile;
diff --git
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiSeekableInputStream.java
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiSeekableInputStream.java
similarity index 98%
rename from
nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiSeekableInputStream.java
rename to
nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiSeekableInputStream.java
index 89d2cc0c32..f3e348be51 100644
---
a/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/main/java/org/apache/nifi/parquet/stream/NifiSeekableInputStream.java
+++
b/nifi-extension-bundles/nifi-parquet-bundle/nifi-parquet-shared/src/main/java/org/apache/nifi/parquet/shared/NifiSeekableInputStream.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.nifi.parquet.stream;
+package org.apache.nifi.parquet.shared;
import org.apache.nifi.stream.io.ByteCountingInputStream;
import org.apache.nifi.stream.io.StreamUtils;
diff --git a/nifi-extension-bundles/nifi-parquet-bundle/pom.xml
b/nifi-extension-bundles/nifi-parquet-bundle/pom.xml
index 87bd359ad6..d2f8500fef 100644
--- a/nifi-extension-bundles/nifi-parquet-bundle/pom.xml
+++ b/nifi-extension-bundles/nifi-parquet-bundle/pom.xml
@@ -26,8 +26,13 @@
<modules>
<module>nifi-parquet-processors</module>
+ <module>nifi-parquet-content-viewer</module>
+ <module>nifi-parquet-shared</module>
<module>nifi-parquet-nar</module>
</modules>
+ <properties>
+ <parquet.version>1.16.0</parquet.version>
+ </properties>
<dependencyManagement>
<dependencies>
<!-- Override commons-beanutils -->
@@ -36,6 +41,43 @@
<artifactId>commons-beanutils</artifactId>
<version>1.11.0</version>
</dependency>
+ <!-- Set provided scope for Hadoop libraries -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-auth</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <version>${avro.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.nimbusds</groupId>
+ <artifactId>nimbus-jose-jwt</artifactId>
+ <version>${nimbus-jose-jwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+
<version>${org.apache.httpcomponents.httpcore.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+
<version>${org.apache.httpcomponents.httpclient.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
</project>