Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-1789

New job that executes SQL script using JDBC

    XMLWordPrintable

    Details

    • Type: Story
    • Status: To Do
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.x
    • Component/s: Batch
    • Labels:
      None

      Description

      Create OOTB batch job that executes SQL script using JDBC - can be used for Hive2 jobs or HAWQ jobs etc.

      Christian Tzolov provided the following baed on Dave Syers JdbcTasklte (https://src.springframework.org/svn/spring-batch-admin/sandbox/cloud-sample/src/main/java/org/springframework/batch/admin/sample/job/JdbcTasklet.java):

      Attached is a simple job module that can run sql commands on Hawq or other DB over jdbc. Just unzip it in <springxd>/xd/modules/job folder and create something like this:
      xd> job create analyticsJob --definition "
      jdbc --driverClassName=org.postgresql.Driver
      --url=jdbc:postgresql://<HAWQ master host>:5432/gpadmin
      --username=gpadmin --password=''
      --sql='CREATE TABLE fonecta_demo.analytics AS
      SELECT segmenttiluokka, count as cnt FROM fonecta_demo.segmenttiluokka
      GROUP BY segmenttiluokka;'" --deploy

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            thomas.risberg Thomas Risberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: