File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
docker-compose/db-plugins-env
saphana-plugin/src/main/java/io/cdap/plugin/saphana Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
12# Copyright © 2019 Cask Data, Inc.
23#
34# Licensed under the Apache License, Version 2.0 (the "License"); you may not
1112# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1213# License for the specific language governing permissions and limitations under
1314# the License.
14- #! /usr/bin/env bash
1515
1616
1717# Tested with Ubuntu 18.04
Original file line number Diff line number Diff line change 2121import io .cdap .cdap .api .annotation .Plugin ;
2222import io .cdap .cdap .etl .api .action .Action ;
2323import io .cdap .plugin .db .batch .action .AbstractDBAction ;
24- import io .cdap .plugin .db .batch .action . QueryConfig ;
24+ import io .cdap .plugin .db .batch .config . DBSpecificQueryConfig ;
2525
2626/**
2727 * Action that runs SAP HANA command.
3131@ Description ("Action that runs a SAP HANA command" )
3232public class SapHanaAction extends AbstractDBAction {
3333
34- public SapHanaAction (QueryConfig config ) {
34+ SapHanaQueryActionConfig sapHanaQueryActionConfig ;
35+
36+ public SapHanaAction (SapHanaQueryActionConfig config ) {
3537 super (config , false );
38+ this .sapHanaQueryActionConfig = config ;
39+ }
40+
41+ public static class SapHanaQueryActionConfig extends DBSpecificQueryConfig {
42+
43+ @ Override
44+ public String getConnectionString () {
45+ return String .format (SapHanaConstants .SAPHANA_CONNECTION_STRING_FORMAT , host , port );
46+ }
3647 }
3748}
Original file line number Diff line number Diff line change 4141@ Description ("Writes records to a SAP HANA table. Each record will be written in a row in the table" )
4242public class SapHanaSink extends AbstractDBSink {
4343
44+ private final SapHanaSinkConfig sapHanaSinkConfig ;
4445 private static final Character ESCAPE_CHAR = '"' ;
4546
47+ public SapHanaSink (DBSinkConfig dbSinkConfig , SapHanaSinkConfig sapHanaSinkConfig ) {
48+ super (dbSinkConfig );
49+ this .sapHanaSinkConfig = sapHanaSinkConfig ;
50+ }
51+
4652 public SapHanaSink (SapHanaSinkConfig sapHanaSinkConfig ) {
4753 super (sapHanaSinkConfig );
54+ this .sapHanaSinkConfig = sapHanaSinkConfig ;
4855 }
4956
5057 @ Override
You can’t perform that action at this time.
0 commit comments