You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Snowflake Ingest Service SDK depends on the following libraries:
17
18
18
-
* snowflake-jdbc (3.16.1+)
19
+
* snowflake-jdbc (3.16.1+)
19
20
* slf4j-api
20
21
* com.github.luben:zstd-jni (1.5.0-1)
21
22
@@ -63,13 +64,16 @@ dependencies {
63
64
64
65
## Jar Versions
65
66
66
-
The Snowflake Ingest SDK provides shaded and unshaded versions of its jar. The shaded version bundles the dependencies into its own jar,
67
-
whereas the unshaded version declares its dependencies in `pom.xml`, which are fetched as standard transitive dependencies by the build system like Maven or Gradle.
68
-
The shaded JAR can help avoid potential dependency conflicts, but the unshaded version provides finer graned control over transitive dependencies.
67
+
The Snowflake Ingest SDK provides shaded and unshaded versions of its jar. The shaded version bundles the dependencies
68
+
into its own jar, whereas the unshaded version declares its dependencies in `pom.xml`, which are fetched as standard transitive
69
+
dependencies by the build system like Maven or Gradle.
70
+
The shaded JAR can help avoid potential dependency conflicts, but the unshaded version provides finer graned control
71
+
over transitive dependencies.
69
72
70
73
## Using with snowflake-jdbc-fips
71
74
72
-
For use cases, which need to use `snowflake-jdbc-fips` instead of the default `snowflake-jdbc`, we recommend to take the following steps:
75
+
For use cases, which need to use `snowflake-jdbc-fips` instead of the default `snowflake-jdbc`, we recommend to take the
76
+
following steps:
73
77
74
78
- Use the unshaded version of the Ingest SDK.
75
79
- Exclude these transitive dependencies:
@@ -78,7 +82,8 @@ For use cases, which need to use `snowflake-jdbc-fips` instead of the default `s
78
82
-`org.bouncycastle:bcprov-jdk18on`
79
83
- Add a dependency on `snowflake-jdbc-fips`.
80
84
81
-
See [this test](https://github.com/snowflakedb/snowflake-ingest-java/tree/master/e2e-jar-test/fips) for an example how to use Snowflake Ingest SDK together with Snowflake FIPS JDBC Driver.
85
+
See [this test](https://github.com/snowflakedb/snowflake-ingest-java/tree/master/e2e-jar-test/fips) for an example how
86
+
to use Snowflake Ingest SDK together with Snowflake FIPS JDBC Driver.
82
87
83
88
# Example
84
89
@@ -89,16 +94,23 @@ Check out `SnowflakeIngestBasicExample.java`
89
94
## Snowpipe Streaming
90
95
91
96
Check out `SnowflakeStreamingIngestExample.java`, which performs following operations:
92
-
1. Reads a JSON file which contains details regarding Snowflake Account, User, Role and Private Key. Take a look at `profile_streaming.json.example` for more details.
93
-
1.[Here](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication) are the steps required to generate a private key.
94
-
2. Creates a `SnowflakeStreamingIngestClient` which can be used to open one or more Streaming Channels pointing to the same or different tables.
97
+
98
+
1. Reads a JSON file which contains details regarding Snowflake Account, User, Role and Private Key. Take a look at
99
+
`profile_streaming.json.example` for more details.
100
+
1.[Here](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#configuring-key-pair-authentication) are the
101
+
steps required to generate a private key.
102
+
2. Creates a `SnowflakeStreamingIngestClient` which can be used to open one or more Streaming Channels pointing to the
103
+
same or different tables.
95
104
3. Creates a `SnowflakeStreamingIngestChannel` against a Database, Schema and Table.
96
-
1. Please note: The database, schema and table is expected to be present before opening the Channel. Example SQL queries to create them:
105
+
1. Please note: The database, schema and table is expected to be present before opening the Channel. Example SQL
106
+
queries to create them:
107
+
97
108
```sql
98
109
create or replacedatabaseMY_DATABASE;
99
110
create or replaceschemaMY_SCHEMA;
100
111
create or replacetableMY_TABLE(c1 number);
101
112
```
113
+
102
114
4. Inserts 1000 rows into the channel created in 3rd step using the `insertRows` API on the Channel object
103
115
1.`insertRows` API also takes in an optional `offsetToken` String which can be associated to this batch of rows.
104
116
5. Calls `getLatestCommittedOffsetToken` on the channel until the appropriate offset is found in Snowflake.
@@ -123,28 +135,34 @@ mvn package
123
135
However, for general usage, pulling a pre-built jar from maven is
124
136
recommended.
125
137
126
-
If you would like to run SnowflakeIngestBasicExample.java or SnowflakeStreamingIngestExample.java in the example folder,
138
+
If you would like to run SnowflakeIngestBasicExample.java or SnowflakeStreamingIngestExample.java in the example folder,
127
139
please edit `pom.xml` and change the scope of the dependency `slf4j-simple` from `test` to `runtime` in order to enable
128
-
console log output.
129
-
140
+
console log output. For changing the logging level or message format, updating the system property or a
141
+
simplelogger.properties file on the classpath is required, please
142
+
see https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html for more details. If you run into formatting errors,
143
+
please run format.sh to format the code.
130
144
131
145
# Testing (SimpleIngestIT Test)
132
146
133
-
-Modify `TestUtils.java` file and replace *PROFILE_PATH* with `profile.json.example` for testing.
147
+
- Modify `TestUtils.java` file and replace *PROFILE_PATH* with `profile.json.example` for testing.
134
148
135
-
-`profile.json` is used because an encrypted file will be
136
-
decrypted for Github Actions testing. Check `End2EndTest.yml`
149
+
-`profile.json` is used because an encrypted file will be
150
+
decrypted for Github Actions testing. Check `End2EndTest.yml`
137
151
138
-
- Use an unencrypted version(Only for testing) of private key while generating keys(private and public pair) using OpenSSL.
152
+
- Use an unencrypted version(Only for testing) of private key while generating keys(private and public pair) using
Each PR must pass all required github action merge gates before approval and merge. In addition to those tests, you will need:
160
+
Each PR must pass all required github action merge gates before approval and merge. In addition to those tests, you will
161
+
need:
146
162
147
-
- Formatter: run this script [`./format.sh`](https://github.com/snowflakedb/snowflake-ingest-java/blob/master/format.sh) from root
148
-
- CLA: all contributers must sign the Snowflake CLA. This is a one time signature, please provide your email so we can work with you to get this signed after you open a PR.
163
+
- Formatter: run this script [`./format.sh`](https://github.com/snowflakedb/snowflake-ingest-java/blob/master/format.sh)
164
+
from root
165
+
- CLA: all contributers must sign the Snowflake CLA. This is a one time signature, please provide your email so we can
166
+
work with you to get this signed after you open a PR.
149
167
150
168
Thank you for contributing! We will review and approve PRs as soon as we can.
0 commit comments