Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2956#discussion_r222760950
  
    --- Diff: 
nifi-nar-bundles/nifi-neo4j-bundle/nifi-neo4j-processors/src/main/java/org/apache/nifi/processors/neo4j/AbstractNeo4JCypherExecutor.java
 ---
    @@ -0,0 +1,280 @@
    +/*
    + * 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.processors.neo4j;
    +
    +import java.io.File;
    +import java.util.concurrent.TimeUnit;
    +
    +import org.apache.commons.lang3.StringUtils;
    +import org.apache.nifi.annotation.lifecycle.OnScheduled;
    +import org.apache.nifi.annotation.lifecycle.OnStopped;
    +import org.apache.nifi.components.AllowableValue;
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.components.PropertyValue;
    +import org.apache.nifi.expression.ExpressionLanguageScope;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.Relationship;
    +import org.apache.nifi.processor.exception.ProcessException;
    +import org.apache.nifi.processor.util.StandardValidators;
    +import org.neo4j.driver.v1.AuthTokens;
    +import org.neo4j.driver.v1.Config;
    +import org.neo4j.driver.v1.Config.ConfigBuilder;
    +import org.neo4j.driver.v1.Config.LoadBalancingStrategy;
    +import org.neo4j.driver.v1.Config.TrustStrategy;
    +import org.neo4j.driver.v1.Driver;
    +import org.neo4j.driver.v1.GraphDatabase;
    +
    +/**
    + * Abstract base class for Neo4JCypherExecutor processors
    + */
    +abstract class AbstractNeo4JCypherExecutor extends AbstractProcessor {
    +
    +    protected static final PropertyDescriptor QUERY = new 
PropertyDescriptor.Builder()
    +            .name("neo4J-query")
    +            .displayName("Neo4J Query")
    +            .description("Specifies the Neo4j Query.")
    +            .required(true)
    +            
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
    --- End diff --
    
    What if the Cypher query was the content of the incoming flow file? 
ExecuteSQL makes this property not required, and if left empty, it assumes that 
the query is in the flow file content and uses that. I've seen some pretty 
large Cypher queries, in this case I'd need an ExtractText to get the whole 
thing into an attribute just so I can pass it back to this property via 
Expression Language.
    
    It's not a total deal-breaker for me, just wanted to suggest/recommend it 
for user-friendliness. I know for ExecuteSQL that property is very often left 
blank, as something upstream generates the SQL as the body of the flow file.


---

Reply via email to