turcsanyip commented on code in PR #9753:
URL: https://github.com/apache/nifi/pull/9753#discussion_r1983336398
##########
nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java:
##########
@@ -197,7 +266,37 @@ public void onScheduled(final ProcessContext context)
throws IOException {
HttpTransport httpTransport = new
ProxyAwareTransportFactory(proxyConfiguration).create();
- driveService = createDriveService(context, httpTransport,
DriveScopes.DRIVE_METADATA_READONLY);
+ driveService = createDriveService(context, httpTransport,
DriveScopes.DRIVE, DriveScopes.DRIVE_METADATA_READONLY);
+ }
+
+ @OnScheduled
+ @Override
+ // initListedEntityTracker() needs to be overridden because the super
implementation calls getRecordSchema()
+ // so recordSchema must be initialized before that
Review Comment:
Not an issue in the reimplemented version.
##########
nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java:
##########
@@ -197,7 +266,37 @@ public void onScheduled(final ProcessContext context)
throws IOException {
HttpTransport httpTransport = new
ProxyAwareTransportFactory(proxyConfiguration).create();
- driveService = createDriveService(context, httpTransport,
DriveScopes.DRIVE_METADATA_READONLY);
+ driveService = createDriveService(context, httpTransport,
DriveScopes.DRIVE, DriveScopes.DRIVE_METADATA_READONLY);
+ }
+
+ @OnScheduled
+ @Override
+ // initListedEntityTracker() needs to be overridden because the super
implementation calls getRecordSchema()
+ // so recordSchema must be initialized before that
+ public void initListedEntityTracker(ProcessContext context) {
+ this.enrichAttributes = new ArrayList<>();
+
+ final List<RecordField> recordFields = new ArrayList<>();
+
+ Stream.of(
+ GoogleDriveFlowFileAttribute.ID,
+ GoogleDriveFlowFileAttribute.FILENAME,
+ GoogleDriveFlowFileAttribute.SIZE,
+ GoogleDriveFlowFileAttribute.SIZE_AVAILABLE,
+ GoogleDriveFlowFileAttribute.TIMESTAMP,
+ GoogleDriveFlowFileAttribute.CREATED_TIME,
+ GoogleDriveFlowFileAttribute.MODIFIED_TIME,
+ GoogleDriveFlowFileAttribute.MIME_TYPE
+ ).forEach(a -> recordFields.add(a.getRecordField()));
Review Comment:
Not an issue in the reimplemented version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]