Граф коммитов

225 Коммитов

Автор SHA1 Сообщение Дата
Joseph Linn 35976dc088
Fix getIntegerObject() return type (#223) 2022-02-23 19:28:49 +02:00
Yihezkel Schoenbrun 76b05b0f63
Support ingesting with ignoring first record in both SDK and Quickstart (#215)
* Support ingesting with ignoring first record in both SDK and Quickstart

* Rename getIgnoreFirstRecord() to isIgnoreFirstRecord()
2022-02-14 17:43:34 +02:00
Larisa Andreea Danaila a60d0bdabc
Share HTTP client across requests (#196)
* Share HTTP client across requests

* Testing commit rights

* * changed the SingletonHttpClient to a factory
* added Javadocs across
* changed access modifiers to package private

* Updated the README

* Address CR comments

* Address CR comments 2

* UTs and E2Es

Co-authored-by: Larisa Andreea Danaila <dnil@adobe.com>
Co-authored-by: Ionut-Maxim Margelatu <imargela@adobe.com>
2022-02-03 16:52:41 +02:00
Yihezkel Schoenbrun 988681c7a5
Remove mapping requirement, since mappings are no longer required (#214)
* Remove mapping requirement

* Add negative test to ensure ingestion without mapping succeeds
2022-01-31 15:08:20 +02:00
AsafMah 91f81641e0
Support exceptions that don't follow oneapi (#213)
* -If exception doesn't follow oneapi throw dataserviceexception
-Don't throw oneapi for wrong exception

* -Restructed exceptions to enable web exceptions without
-Always propagate cause

* -Simplified check
-Fix PR comments

* Added unit tests
2022-01-23 17:24:52 +02:00
Yihezkel Schoenbrun e2475a4cd2
Remove Quickstart dependency on parent pom (#212) 2022-01-17 16:10:45 +02:00
Yihezkel Schoenbrun 6df93e8835
Remove isMappingRequired from DataFormat (#211)
* Remove isMappingRequired from DataFormat

* Fix tests
2022-01-11 19:14:24 +02:00
AsafMah e85db5514b
Coverage test (#206)
* Coverage test

* attempt 2

* Fixed pom

* Different combination

* Try without e2e

* Try without e2e

* Fixed paths

* Fixed paths

* Added thread id to avoid collisions

* Add random component to table name to avoid collisions

* Make sure number is not negative

Co-authored-by: Yihezkel Schoenbrun <yihezkel@schoenbrun.net>
2022-01-11 16:58:12 +02:00
Yihezkel Schoenbrun 2a5fe98ea3
Fix access modifiers (#210)
* Fix access modifiers

* Add missing call to columnMappings getter

* Add remaining getters to IngestionBlobInfo, which needs to be serialized

* Fix merge conflict issue

Co-authored-by: AsafMah <asafmahlev@microsoft.com>
2022-01-11 16:44:12 +02:00
Yihezkel Schoenbrun 2c583f3a7a
Fix enum nomenclature (#209)
* Fix enum nomenclature

* Fix enum nomenclature

* Fix IngestionBlobInfo to use the String versions of the enums

* Add KustoValue to IngestionReportLevel and IngestionReportMethod enums

* From code review
2022-01-11 16:07:28 +02:00
Yihezkel Schoenbrun ac04421977
Remove dependency on Java 9/a specific version of a specific project of Java 8 (#207)
* Remove dependency on Java 9

* Ingest from stream
2022-01-11 15:53:40 +02:00
Yihezkel Schoenbrun a501f05521
Validate IngestionProperties properly (#205)
* Validate IngestionProperties properly

* Fix tests

* Begin relaxing restrictions

* Allow CSV mappings for RAW and TXT, per Michael Spector

* Remove wildcard imports and add regex explanation

* Throw exception if null passed to setDataFormat()

* Change concatenation to TextStringBuilder

* Add Apache's commons-text to ingest module

* Use Ensure.argIsNotNull()
2022-01-06 18:26:09 +02:00
Yihezkel Schoenbrun c2263cb915
Offer typed parameterized query helpers (#204)
* Offer typed parameterized query helpers

* Offer typed parameterized query helpers

* Improve TimeToString and add E2E test

* Fix PATTERN name

* Update Time datatype to be called Timespan
Implement better parity parsing of datetime from String

* Remove wildcard imports and add regex explanation

* Change single line if/else to ternary
2022-01-06 16:21:06 +02:00
AsafMah 6228ec2edf
Added ManagedStreaming improvements (#198)
* Added ManagedStreaming improvements

* More Changes:
-Added factory methods for easy construction
-Supports non-resettable streams
-Supports LeaveOpen
-Fallback on big files
2022-01-06 15:25:16 +02:00
AsafMah 873e0198d1
Upgrade dependencies + silence warnings (#203)
* Upgrade dependencies + silence warnings

* Upgraded tests

Co-authored-by: Yihezkel Schoenbrun <yihezkel@schoenbrun.net>
2021-12-27 14:24:19 +02:00
ohad bitton a779473d90
Reactivate tests and fix non passed tests (#191)
* E2e

* E2e

* fix tests

* fix tests

* fix tests

* disable prompt

* disable prompt

* e2e

* Fixed test

* Removed not needed dependency

* Quotes

* Revert "Removed not needed dependency"

This reverts commit a7de79e8aa.

* Leave only api

* Fixed test

* Added doc

* Fixed NRE

* Fixed implicit dependency

* Clean up some unnecessary changes

* Ensure DataFormat always exists (defaults to CSV)

* CloudInfo won't have the same values as the default for all connection strings

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
Co-authored-by: Yihezkel Schoenbrun <yihezkel@schoenbrun.net>
Co-authored-by: Asaf Mahlev <asafmahlev@microsoft.com>
Co-authored-by: Yihezkel Schoenbrun <yischoen@microsoft.com>
2021-12-23 15:31:52 +02:00
Yihezkel Schoenbrun e4028c4761
Fix DataFormat bugs and add enhancements (#202)
* Fix DataFormat bugs and add enhancements

* Fix test

* Forgot a small change

* Per code review, moving "format" field in AdditionalProperties to its own strongly-typed field.

* Previously, StreamingIngestClient compressed the stream if it isn't already compressed.

As Asaf noticed, for consistency with the other ingest clients, it should compress if Stream is not already compressed and the DataFormat is compressible.

* Unify and improve mappings validations

* Ensure mapping reference is provided for StreamingIngestClient

* Mapping reference is not necessarily required for StreamingIngestClient - only when mapping is required.

* Align with how this error originally was (though no practical difference)
2021-12-23 12:40:22 +02:00
Yihezkel Schoenbrun 6bec9e7703
Update Quickstart README per suggestions from docs (#200)
* Update per suggestions from docs (Shlomo)

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Update quickstart/README.md

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>

* Updates to docs

* Updates to docs

* Per Shlomo's request

Co-authored-by: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>
2021-12-20 11:02:45 +02:00
Yihezkel Schoenbrun 63519e7a79
Many minor improvements to Quickstart (#201) 2021-12-20 10:38:21 +02:00
Yihezkel Schoenbrun b3d73b8bb1
- Specify runtime scope for slf4j's impl (simple) (#199)
- Do not exclude the slf4j's impl from maven-dependency-plugin
- Relatedly, turn on ignoreNonCompile in maven-dependency-plugin
- Minor readability improvement in ClientImpl constructor
2021-12-12 18:39:21 +02:00
Yihezkel Schoenbrun 438ec1397f
Quickstart Application (#195)
* Initial commit.
The intent is to review this in its current feature-complete state, so I can also commit the equivalent changes in the Python SDK.
Then, in the next PR (or before merging this PR), I will make some additional improvements as discussed, including break main into individual methods and refactor this "query-ingest-query" approach into an additional "query-only" mode.

* Remove comment

* Optimize if/else

* Minor verbiage changes

* Minor verbiage changes

* Minor verbiage changes

* Update README.md

Co-authored-by: Yochai Gilad <yogilad@microsoft.com>

* - Break main up into methods
- Consider new parameters
- Few code review changes, like consistent periods at end of sentences and filename consistency with Python

* Only alter batching policy if !useExistingTable

* - Pass filesize of 0 for autodetection
- Do not create a File object to get its path; just pass along the provided path
- Move alterBatchingPolicy to within createNewTable, and wrap it in if(false) so it won't run
- Add comment explaining that we generally wouldn't print the output of a control command

* - Improve README text
- Change .alter command to .alter-merge command

* - Change filename kusto-sample-config.json to kusto_sample_config.json to be consistent with Python

* - Fix reference to Python
- Aad a comment for AppCertificate auth

Co-authored-by: Yochai Gilad <yogilad@microsoft.com>
2021-12-05 10:39:22 +02:00
AsafMah d43492caff
Added sstream type (#193) 2021-12-05 10:15:46 +02:00
AsafMah afb1ad8142
Updated surefire version to make tests run (#197)
Breaking Changes:

Reverted mandatory DataFormat
Features:

Added github actions for running builds
Fixes:

Fixed pipeline to run and test
Fixed failing tests and other minor fixes
2021-12-05 09:50:49 +02:00
Yihezkel Schoenbrun c37107754d
Support AAD Managed Identity authentication (#194)
* Support AAD Managed Identity authentication

* Update data/src/main/java/com/microsoft/azure/kusto/data/auth/ManagedIdentityTokenProvider.java

Co-authored-by: AsafMah <asafmahlev@microsoft.com>

* Fix scope

* Fix space

* Downgrade azure-identity package to avoid showstopper bug causing ManagedIdentity auth to fail.

Note that there still remains 1 change to be made in this PR - to set the scope based on the Kusto Service Resource ID from CloudInfo. In support of this, I have a 22-file change to broadly improve how the TokenProviders consume from CloudInfo, but am hesitating to push that before understanding the initial CloudInfo design decisions.

At a high level, I would like to change the throws list when creating a client. It currently throws URISyntaxException, because it only uses CloudInfo when a token is requested. However, I don't see why we don't make use of CloudInfo when creating the client, in which case we should return a DataClientException/DataServiceException. This is a breaking change and a non-trivial paradigm shift, so it's worth discussing first.

I will begin discussing this with Asaf tomorrow.

* Resolve dependency conflicts

* Reorganize CloudInfo code

* Fix compilatino error

* Remove superfluous method (determineAadAuthorityUrl)

* Remove duplicate line

* Fix cloudinfo initialization

* Fix E2E tests (have been broken for a while)

* Switch order of clientUrl to be first

Co-authored-by: AsafMah <asafmahlev@microsoft.com>
2021-11-25 08:31:52 +02:00
Yihezkel Schoenbrun b0589700e3
Add to main README link to .NET's best practices guide (#192) 2021-11-01 09:50:34 +02:00
ohad bitton 7309936724
Fix closeable order (#190)
Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2021-10-24 15:26:09 +03:00
ohad bitton 0a2e3c63d1
v3.0.0 (#187) 2021-10-17 11:43:01 +03:00
ohad bitton 674045bfb9
Fix time out as timestamp (#185)
* fix timeout

* revert

* timeout as timespan

* j

* many changes

* better

* clean

* clean

* no auth

* better

* better

* comments

* comments

* comments

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2021-10-15 13:39:28 +03:00
Yihezkel Schoenbrun cde2361654
Implement MSAL Subject Name Issuer authentication (#165)
* Implement MSAL Subject Name Issuer authentication

* Update ConnectionStringBuilder.java

* Update ConnectionStringBuilder.java

* Fix build failure after OnCloudInit() was added to abstract parent

* Ensure we send the public certificate when using SNI

Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>
2021-08-23 15:37:56 +03:00
Yihezkel Schoenbrun c905a4261d
Minor fixes, including enum naming convention (DATA_FORMAT to DataFormat) (#183) 2021-08-23 15:30:28 +03:00
Yihezkel Schoenbrun 69aa7e3ca4
Add x-ms-activitycontext and x-ms-user-id headers (#181)
* Add x-ms-activitycontext and x-ms-user-id headers

* Protect better against empty ClientRequestId

* Revert KustoDataExceptionBase to be abstract
2021-08-23 14:08:53 +03:00
ohad bitton 48ba143e24
Remove resultSet (#180)
* remove resultSet

* nit

* nit

* getAdditionalProperties

* nit

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
2021-07-13 17:46:29 +03:00
ohad bitton d6075a252e
Update pom.xml 2021-07-04 16:17:55 +03:00
KustoIbizaExtension Build 2ba8a75629 Merge remote-tracking branch 'origin/master' 2021-07-04 15:55:37 +03:00
KustoIbizaExtension Build 5d57fae87a Ingestion status 2021-07-04 15:27:43 +03:00
AsafMah d5de3419b6
Made url join more robust (#179) 2021-07-01 18:03:39 +03:00
AsafMah e2bbcd11d2
Bump to 2.8.0 2021-06-30 18:33:03 +03:00
AsafMah d16a2715ee
Add metadata endpoint (#177)
* Kusto now queries the provided cluster for metadata. This fixes incompatibility issues with other clouds, or services like Synapse. The results are cached and don't require any changes to the user's code or behavior.
2021-06-30 10:41:31 +03:00
KustoIbizaExtension Build f70cf8b8c0 2.7.1 2021-06-29 15:49:20 +03:00
ohad bitton a110f859f2
githubrepo usr (#173) 2021-06-29 15:30:16 +03:00
ohad bitton b2155aa5e8
Primitive object getters to support Null values (#176)
* new API to get primitive as objects to handle null values

* nulls

* better

* comments

* comments

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
2021-06-29 13:47:00 +03:00
AsafMah 1f1d1245b4
Fixed old readme code (#178) 2021-06-27 14:02:48 +03:00
ohad bitton 03aabae864
Exceptions handling (#174)
* exception handling

* nicer errors

* permanency

* is permanent exceptions

* isPermanent as triState

* enum triState

* enum triState

* better errors

* nit

* naming - KustoServiceQueryError

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
2021-05-25 15:54:20 +03:00
Yihezkel Schoenbrun 2bb0d1b8b8
Upgrade version from 2.6.0 to 2.7.0 (#172) 2021-04-11 21:30:29 +03:00
Yihezkel Schoenbrun ad652df53a
Add streaming query API (#170)
* Add streaming query API

* - Add some resource closing enhancements
- Wrap the CloseParentResourcesStream in a EofSensorInputStream, as opposed to the converse

* Add TODO to reuse HttpClient

* Use existing Java exception formatting, which is an improvement over the .NET exception
2021-04-11 18:46:34 +03:00
ohad bitton 133b5e254f
Device authentication (#169)
* device authentication

* revert device E2E

* comments

* make base class protected

* make base class protected
2021-03-22 18:31:14 +02:00
Yihezkel Schoenbrun 97ae1807cb
Upgrade version to 2.5.1 (#168) 2021-03-11 12:08:33 +02:00
Yihezkel Schoenbrun 9a5976860c
Add new API to query returning a json result (#166)
* Add new API to query so that the result is a json. When the caller doesn't need the Java object, this saves time converting to a Java object in the SDK and from the caller converting from the Java object.

* - Split input variables validation
- trim() command

* Rename from executeForJsonResult to executeToJsonResult

* Rename from executeForJsonResult to executeToJsonResult

* Streaming endpoint is always v1
2021-03-09 12:39:38 +02:00
Yihezkel Schoenbrun ce1a716062
Optimize and upgrade dependency versions (#167)
* - Optimize and upgrade dependency versions
- Remove dependency duplicates/conflicts
- Resolve mvn warnings

* - Use range to ensure specific minor version of jackson dependencies
- Upgrade flatten-maven-plugin
2021-03-08 17:31:42 +02:00
Yihezkel Schoenbrun 6ae22dcb6f
Optimize ResourceManager and minor improvements in a few other classes (#163)
* Optimize ResourceManager and minor improvements in a few other classes

* Change naming from storageRoot to storageUrl
2021-03-03 19:23:55 +02:00