Git Product home page Git Product logo

nifi-sqllookup-services-bundle's Introduction

Apache NiFi SQL Lookup Service

Build Status

About

NiFI SQL Lookup Service is a SQL-based lookup service for Apache NiFi. It allows you to enrich your flowfiles with any jdbc-compliant data store, including:

  • PostgreSQL
  • Oracle
  • MySQL
  • MS SQL Server
  • SQLite
  • ... and many more

It includes both LookupRecord and LookupAttribute controllers.

These controllers were designed to be flexible and fast.

Simple Setup

> cd nifi-sqllookup-bundle
> mvn package
> cp ./nifi-sqllookup-services-nar/target/nifi-sqllookup-services-nar-1.15.0.nar /NIFI_INSTALL/lib/
> cp ./nifi-sqllookup-services-api-nar/target/nifi-sqllookup-services-api-nar-1.15.0.nar /NIFI_INSTALL/lib/
  • Start NiFi

SQL Query Support

This service supports multiple query types:

  • Named Parameters: SELECT name FROM foo WHERE value = :value
  • SQL IN queries: SELECT name FROM foo WHERE value IN(:values)
  • Multiple lookup values: SELECT name FROM foo WHERE value IN(:values) AND sequence = :sequence AND catalog = :catalog

Caching

The goal of this service is to return values quickly. It has a built-in cache so that your database doesn't get overwhelmed.

This is configurable in the controller settings.

Supported caches

These caches are all built-in to this service. Select your preferable cache in the controller settings.

You can also select the number of items that you want to cache. The caches all keep the most accessed items available by default.

If you don't know which to choose, just go with the default.

Latest release

https://github.com/mrcsparker/nifi-sqllookup-services-bundle/releases/latest

Articles on using NiFi lookup services

nifi-sqllookup-services-bundle's People

Contributors

deem0n avatar mrcsparker avatar phillipjohnson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nifi-sqllookup-services-bundle's Issues

How to use this service in Lookup attribute?

Hi!
I would like to use this service in LookupAttribute processor to find an Agent ID based on Agent Name and Agent Version that I get from FlowFile.

I've tried using this service in LookupAttribute but I don't know how to provide those two values to the service through the processor.

In your example you say that this service supports named parameters, for example:

SELECT name FROM foo WHERE sequence = :sequence AND catalog = :catalog

So I've tried putting it in the service with following query:

SELECT agent_id FROM agent WHERE agent_name = :agent_name AND agent_version = :agent_version

I've tried many ways of trying to provide values for these two parameters, but couldn't get it to work with LookupAttribute.
Then I've tried to simplify the SQL query, just to see if I can get it to work and used:

SELECT agent_id FROM agent WHERE agent_name = :agent_name

In LookupAttribute I've defined the property agent _id and given it various values such as "agent_name", "${agent_name}", "agent_name=${agent_name}", "agent_name,${agent_name}", and more, but it didn't work, every time I got following error when I tried running the LookupAttribute processor:

LookupAttribute[id=d9aa39f8-4bc7-1fe5-a4e4-9130dd75dfbf] Processing halted: yielding [1 sec]: org.springframework.dao.InvalidDataAccessApiUsageException: No value supplied for the SQL parameter 'agent': No value registered for key 'agent_name'

I've tried looking through source code to figure out how to fix this, but I have no idea.
Could you help me?

SQLLookUp controllers do not take context attributes - such as flowFile attributes passed

I needed to make SQL query used by the processor a template. like select source, ${id_column} from ${table} where ${id_column} = : , based on in coming flowFile. This was not possible, as these controllers did not override second form of lookup : lookup(coordinates,context) - call
Made do with my own fork.
I feel this is a useful feature. Great work! I really appreciate its help in my project

Latest release not building with Java 8

Latest release is not building with Java 8.0.302. Got a compilation error on nifi-sqllookup-services. Switched to Java 11 and then it works fine. Any suggestions?

StringLookupService support

This is clearly not a bug, but a feature request,
It would be marvelous if this was supporting the StringLookupService Controller Service as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.