[ 
https://issues.apache.org/jira/browse/NIFI-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Toivo Adams updated NIFI-626:
-----------------------------
    Attachment: NIFI-626_25may2015.patch

Attached please find initial implementation.
Tests are incomplete, some functionality is not yet implemented.

I wanted to make sure streaming is working.
(streaming experiments was pretty promising, just final processor test is not 
done)

But I don't know how to add Connection pooling service to Junit test.
Currently test will fail:
java.lang.NullPointerException
        at 
java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
        at 
java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1125)
        at 
org.apache.nifi.util.MockControllerServiceLookup.addControllerService(MockControllerServiceLookup.java:33)
        at 
org.apache.nifi.util.MockControllerServiceLookup.addControllerService(MockControllerServiceLookup.java:38)
        at 
org.apache.nifi.util.MockProcessContext.addControllerService(MockProcessContext.java:153)
        at 
org.apache.nifi.util.StandardProcessorTestRunner.addControllerService(StandardProcessorTestRunner.java:538)
        at 
org.apache.nifi.processors.standard.TestExecuteSQL.test1(TestExecuteSQL.java:72)
        . . .

test itself

    @Test
    public void test1() throws InitializationException {
        final TestRunner runner = TestRunners.newTestRunner(ExecuteSQL.class);
        
        final DBCPService dbcp = new DBCPServiceSimpleImpl();
        final Map<String, String> dbcpProperties = new HashMap<>();
        dbcpProperties.put("Database Host", "NA");    // Embedded Derby don't 
use host
        dbcpProperties.put("Database Port", "1");  // Embedded Derby don't use 
port, but must have value anyway
        dbcpProperties.put("Database Name", DB_LOCATION);
        dbcpProperties.put("Database User",     "tester");
        dbcpProperties.put("Password", "testerp");

        runner.addControllerService("dbcp", dbcp, dbcpProperties);   <=== test 
fail here


please help
toivo


> ExecuteSQL processor for executing arbitrary SQL queries
> --------------------------------------------------------
>
>                 Key: NIFI-626
>                 URL: https://issues.apache.org/jira/browse/NIFI-626
>             Project: Apache NiFi
>          Issue Type: Sub-task
>            Reporter: Toivo Adams
>            Assignee: Toivo Adams
>         Attachments: NIFI-626_25may2015.patch
>
>
> For example query can be:
> SELECT * FROM orders WHERE orderId = '${order.id}'
> where ${order.id} is FlowFile attribute.
> Result will serialized using Avro.
> Avro gives as possibility to have query Resultset metadata (column name and 
> types) included in FlowFile.
> Also Avro should allow streaming.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to