-
Notifications
You must be signed in to change notification settings - Fork 2.3k
DataFusionReaderManager UTs #19910
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
base: feature/datafusion
Are you sure you want to change the base?
DataFusionReaderManager UTs #19910
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,6 @@ public DatafusionReader(String directoryPath, Collection<WriterFileSet> files) { | |
| System.out.println("Directory path: " + directoryPath); | ||
|
|
||
| this.cachePtr = DataFusionQueryJNI.createDatafusionReader(directoryPath, fileNames); | ||
| incRef(); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -95,8 +94,7 @@ public void close() throws IOException { | |
| if(cachePtr == -1L) { | ||
| throw new IllegalStateException("Listing table has been already closed"); | ||
| } | ||
|
|
||
| // closeDatafusionReader(this.cachePtr); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we remove this, shouldn't we close the datafusion reader / clear the listing table cache ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rightt. Let me add it back
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| closeDatafusionReader(cachePtr); | ||
| this.cachePtr = -1; | ||
| } | ||
| } | ||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are removing it? When we are creating it, we will want to keep it 1 right?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already incrementing it from ReaderManager where the call is made to this constructor.
We can either increment when
-> this way it is only incremented after ReaderManager is updated with Reader reference
My assumption was more around Reader increment being associated with ReaderManager
Any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not right, since this kind of does not enforce current ref count to be 1 and is more error prone. The manager can incRef and decRef based on acquire/release but the initialisation with
1ref count should be handled by the Reader itself. This way user don't have to worry about it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can do something like this which is being done in IndexReader:
Let's initialise it with 1 always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted. Let me initialize the refCount from 1