Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingest updates for split #198

Merged
merged 20 commits into from
Aug 9, 2023
Merged

Ingest updates for split #198

merged 20 commits into from
Aug 9, 2023

Conversation

AsafMah
Copy link
Contributor

@AsafMah AsafMah commented Jul 19, 2023

  • [BREAKING] [MAJOR] Constructing ingest clients is now done using a KustoConnectionStringBuilder, and not a client struct.

  • In addition, passing a default database and table for ingestion is not necessary anymore, and can be done using Options.

    // before:
     queryClient := kusto.New("https://ingest-somecluster.kusto.windows.net")
     client := ingest.New(quetryClient, "some-db", "some-table")
    
     // after:
     client := azkustoingest.New("https://ingest-somecluster.kusto.windows.net", azkustoingest.WithDefaultDatabase("someDb"), azkustoingest.WithDefaultTable("someTable"))
  • Added autocorrection for endpoints for ingest clients. When creating a client, the "ingest-" will be added or removed as needed. To avoid this behavior, use the azkustoingest.WithoutEndpointCorrection() option.

  • ManagedStreamingClient constructor now only requires the query endpoint, and will infer the ingest endpoint from it. If you want to use a different endpoint, use the azkustoingest.WithCustomIngestConnectionString() option.

  • Removed the old deprecated Stream() method on queued ingest client, instead use azkustoingest.NewStreaming() or azkustoingest.NewManaged() for proper streaming ingest client.

  • Removed QueryIngestion() option for Query client. If you want to perform commands against the dm, create a query client with the "ingest-" endpoint.

AsafMah added 4 commits July 18, 2023 12:55
…KustoConnectionStringBuilder, and not a client struct.

* In addition, passing a default database and table for ingestion is not necessary anymore, and can be done using Options.
   ```go
   // before:
  	queryClient := kusto.New("https://ingest-somecluster.kusto.windows.net")
    client := ingest.New(quetryClient, "some-db", "some-table")

    // after:
    client := azkustoingest.New("https://ingest-somecluster.kusto.windows.net", azkustoingest.WithDefaultDatabase("someDb"), azkustoingest.WithDefaultTable("someTable"))
  ```
* Added autocorrection for endpoints for ingest clients. When creating a client, the "ingest-" will be added or removed as needed. To avoid this behavior, use the `azkustoingest.WithoutEndpointCorrection()` option.
* ManagedStreamingClient constructor now only requires the query endpoint, and will infer the ingest endpoint from it. If you want to use a different endpoint, use the `azkustoingest.WithCustomIngestConnectionString()` option.
* Removed the old deprecated Stream() method on queued ingest client, instead use azkustoingest.NewStreaming() or azkustoingest.NewManaged() for proper streaming ingest client.
* Removed `QueryIngestion()` option for Query client. If you want to perform commands against the dm, create a query client with the "ingest-" endpoint.
@github-actions
Copy link

github-actions bot commented Jul 19, 2023

Test Results

486 tests  +30   486 ✔️ +30   16m 31s ⏱️ - 15m 11s
  27 suites ±  0       0 💤 ±  0 
    2 files   ±  0       0 ±  0 

Results for commit 1dbb4da. ± Comparison against base commit efea954.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #198 (74d5714) into the-big-split (efea954) will increase coverage by 1.21%.
The diff coverage is 80.16%.

❗ Current head 74d5714 differs from pull request most recent head 1dbb4da. Consider uploading reports for the commit 1dbb4da to get more accurate results

@@                Coverage Diff                @@
##           the-big-split     #198      +/-   ##
=================================================
+ Coverage          49.56%   50.78%   +1.21%     
=================================================
  Files                 54       54              
  Lines               5909     5919      +10     
=================================================
+ Hits                2929     3006      +77     
+ Misses              2765     2699      -66     
+ Partials             215      214       -1     
Files Changed Coverage Δ
azkustodata/kusto.go 18.22% <ø> (+2.93%) ⬆️
azkustodata/mock.go 65.88% <ø> (-0.79%) ⬇️
azkustodata/queryopts.go 3.49% <ø> (+0.06%) ⬆️
azkustoingest/ingest.go 68.42% <56.00%> (+16.27%) ⬆️
azkustoingest/streaming.go 76.98% <68.42%> (-2.11%) ⬇️
azkustoingest/managed.go 76.19% <87.50%> (+0.81%) ⬆️
azkustoingest/ingestion_options.go 91.52% <91.52%> (ø)
azkustoingest/internal/resources/resources.go 57.64% <100.00%> (ø)

@yogilad yogilad requested review from yogilad and ohadbitt July 23, 2023 11:08
CHANGELOG.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,109 @@
package azkustoingest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose the name "Common"?
Isn't Options more suitable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to ingestion_options

azkustoingest/common.go Outdated Show resolved Hide resolved
azkustoingest/streaming.go Show resolved Hide resolved
azkustoingest/managed.go Show resolved Hide resolved
@@ -171,6 +189,10 @@ func (i *Streaming) newProp() properties.All {
}
}

func (i *Streaming) QueryClient() QueryClient {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a public API?
Do we need it for something other than tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting access to the client is useful, otherwise to run commands like changing the batching will require creating a new one.
It does save work on tests, but I think it's useful regardless.

)

type Ingestor interface {
io.Closer
FromFile(ctx context.Context, fPath string, options ...FileOption) (*Result, error)
FromReader(ctx context.Context, reader io.Reader, options ...FileOption) (*Result, error)
QueryClient() QueryClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the ingest API publicly expose a Query Client?

@AsafMah AsafMah merged commit 94df5a7 into the-big-split Aug 9, 2023
AsafMah added a commit that referenced this pull request Mar 11, 2024
* Split & rename modules

* fix go.mod

* rename to azkustodata and azkustoingest

* update

* Update build.yml

* build.yml changes

* fixes

* build

* fixed merge

* try

* restore dataset.csv

* ### Added
- azidentity package dependency

### Changed
- Update azkustoingest/test/etoe/etoe_test.go to use azkustoingest.FileOption

### Fixed

### Removed

### Security

* Fixed

* Centralize deps

* Fixed once_test.go

* Fixed once_test.go

* Fixed once_test.go

* Minor fixes

* Solved flakeyness maybe

* remove replace

* no replacements

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Will this fail?

* Ok check 1

* Tidy

* TidyDoc fixes

* Split e2e tests

* Updated deps

* go work sync

* this is not good

* Test change

* Test change

* PR fixes

* Fix more

* Stop more queries

* Stop more queries

* Check if problem test

* Rename package

* Rename package

* Rename package

* Gofmt

* Fixed error

* tidy

* Tidy part 2

* go.sum

* Ingest updates for split (#198)

* * [BREAKING] [MAJOR] Constructing ingest clients is now done using a KustoConnectionStringBuilder, and not a client struct.
* In addition, passing a default database and table for ingestion is not necessary anymore, and can be done using Options.
   ```go
   // before:
  	queryClient := kusto.New("https://ingest-somecluster.kusto.windows.net")
    client := ingest.New(quetryClient, "some-db", "some-table")

    // after:
    client := azkustoingest.New("https://ingest-somecluster.kusto.windows.net", azkustoingest.WithDefaultDatabase("someDb"), azkustoingest.WithDefaultTable("someTable"))
  ```
* Added autocorrection for endpoints for ingest clients. When creating a client, the "ingest-" will be added or removed as needed. To avoid this behavior, use the `azkustoingest.WithoutEndpointCorrection()` option.
* ManagedStreamingClient constructor now only requires the query endpoint, and will infer the ingest endpoint from it. If you want to use a different endpoint, use the `azkustoingest.WithCustomIngestConnectionString()` option.
* Removed the old deprecated Stream() method on queued ingest client, instead use azkustoingest.NewStreaming() or azkustoingest.NewManaged() for proper streaming ingest client.
* Removed `QueryIngestion()` option for Query client. If you want to perform commands against the dm, create a query client with the "ingest-" endpoint.

* Tests and docs

* More tests

* fmt

* fmt

* Try to improve build errors

* f

* f

* Try again

* Try again

* Try again

* Fix

* Update README.md

Co-authored-by: Yochai Gilad <[email protected]>

* Update azkustoingest/common.go

Co-authored-by: Yochai Gilad <[email protected]>

* Rename

* Remove queryclient

* Remove queryclient

* Remove queryclient

* Remove queryclient

---------

Co-authored-by: Yochai Gilad <[email protected]>

* Merge branch 'master' into query-v2

* merge from main

* Updated deps

* Fixed

* Merge fixes

* Merge fixes

* Query v2 (#216)

* Frame definitions

* Working json (kinda)

* Improved values

* Improved values

* Improved values

* Compilation errors

* More fixes

* meanwhile commit

* merge from main

* Reworked kusto types -
No more duplications between packages.
Removed old system of query building.
Fixed tests, etc.

* Query v2 - tables, frames, all

* Added query

* More tests

* Working tests

* More tests

* Something is off

* Something is off

* Fixed error

* More tests, more tables

* Fixed tests, aligned types, etc

* -int types can be deserialized to struct (with error on overflow)
-fixed secondary tables

* Easy row consumption and op for errors

* Some docs

* Examples and tests

* Fixed tests

* Fixed data races. Removed fixed table (for now)

* Fixed deadlock + parallel tests

* Fixed deadlocks

* Fixed deadlocks

* Rework tables into results

* Big refactor - split common data from v2 specific

* More v1 stuff

* More v1 stuff

* Moving stuff around for compile errors

* Fixed tests

* Fixed recursive lock issue

* Fixed recursive lock issue

* Fixed recursive lock issue

* Fixed missing break

* Fixed missing break

* Fixed test

* Make sure the correct error is always called, without race condition

* Make sure the correct error is always called, without race condition

* Make sure the correct error is always called, without race condition

* upgrade

* Merge fixes

* Merge fixes

* Tests and fixes

* Tests and fixes

* Split v2 tables to streaming and non-streaming

* Fixed tests

* Renames

* Fixed error

* Renaming

* More api and partial results test

* Fixed read

* Some docs

* -Renames and add apis
-Fixed partial Results text
-Fixed full errors tests

* full dataset tests

* Fixed tests

* Handle partial errors in v2 & fixed number handling in v1

* Naming and comments

* PR fixes

* PR fixes

* Added error description and table progress

* Added error description and table progress

* Fix tests

* PR fixes

* Fix tests

* Removed more old code, fixed tests, still wip

* Fixed all tests

* Fixed + added benchmark

* Fixed ingest tests by relocating mock

* Fixed tests

* More fixed tests

* Fixed race

* typo

* remove todo (for now)

* Cherrypick changes from other branch

* -Simplify and rename

* PR Changes:
- Simplify code to handle only what needed
- Rename ordinal to index
- Some comments

* Fixed samples

* Fixed cycle

* Removed old full dataset things

* Renames and bug fixes

* Aligned types, made full tables make more sense.

* Properly close tables, fixed deadlocks and tests.

* Fixed ingest tests

* Fixed test

* build.yml

* Updated sample app

* Improve allocations and fix benchmarks

* Improve values system

* -Reduced code dups in structs
-Fixed edge cases

* Jsontest - correct order of params

* cache decodeToStruct result

* PR stuff

* PR stuff

* PR changes - part 1

* PR Changes - renames

* Readne

* Lock Cache

* Docs and migration for 1.0.0 (#225)

* Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#219)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /quickstart (#218)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Changed just sstream to false. the rest was fine (#220)

* Update issue templates (#223)

* Update build.yml

* Update build.yml (#224)

* T ronmoneta/compression auto detect fix (#222)

* Changed just sstream to false. the rest was fine

* Switched rows

* New doc files and Migration guide

* Update MIGRATION.md

Co-authored-by: ohad bitton <[email protected]>

* Update MIGRATION.md

Co-authored-by: ohad bitton <[email protected]>

* Update MIGRATION.md

Co-authored-by: Yochai Gilad <[email protected]>

* New doc files and Migration guide

* Last fixes

* azkustodata tidy

* version fixing

* version fixing

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: t-ronmoneta <[email protected]>
Co-authored-by: ohad bitton <[email protected]>
Co-authored-by: Yochai Gilad <[email protected]>

* v1.0.0-preview

* last adjustments

* last adjustments

* last adjustments

* last adjustments

* last adjustments

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yochai Gilad <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: t-ronmoneta <[email protected]>
Co-authored-by: ohad bitton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants