-
Notifications
You must be signed in to change notification settings - Fork 62
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
Initializes PartiQLCursor and PartiQLValueLoader #1467
Conversation
@@ -1176,7 +1177,7 @@ class PartiQLEngineDefaultTest { | |||
throw returned.cause | |||
} | |||
} | |||
val output = result.value | |||
val output = PartiQLValueLoader.standard().load(result.value) |
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.
Is there anything other than "standard"?
* This is only applicable when the current value's type is {@link PartiQLValueType#CHAR}. | ||
*/ | ||
@NotNull | ||
String getCharValue(); |
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.
String getCharValue(); | |
Char getCharValue(); |
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.
This method will be deleted in accordance with your other suggestion of following the JVM names. Also, side note, the CHAR datatype in SQL acts more like Java's String.
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.
Same as PQLValue I was thinking
char --> char(1) -- fixed-length char 1
It should return char[]
be called getChars()
— at a minimum it should be plural.
partiql-types/src/main/java/org/partiql/value/PartiQLCursor.java
Outdated
Show resolved
Hide resolved
/** | ||
* @return a basic implementation of {@link PartiQLValueLoader}. | ||
*/ | ||
static PartiQLValueLoader standard() { |
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.
static PartiQLValueLoader standard() { | |
static PartiQLValueLoader 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.
"default" is a Java keyword. Found this out recently when I was writing Java and was trying to use a method named 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.
Makes me wonder if we should be changing the 1.0 builder names ...
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.
One minor change, otherwise looks good.
/** | ||
* This is applicable to the following types: | ||
* {@link PartiQLValueType#BLOB} | ||
* @return a value representing the applicable PartiQL value | ||
* @throws UnsupportedOperationException when this method is not applicable to the type returned by {@link PartiQLCursor#getType()} | ||
* @throws NullPointerException if this method is invoked when {@link PartiQLCursor#isNull()} returns true | ||
* @apiNote <b>! ! ! EXPERIMENTAL ! ! !</b> This is an experimental API under development by the PartiQL maintainers. | ||
* Please abstain from using this API until given notice otherwise. This may break between iterations without prior notice. | ||
*/ | ||
@NotNull | ||
public Blob getBlob() throws UnsupportedOperationException, NullPointerException; | ||
|
||
/** | ||
* This is applicable to the following types: | ||
* {@link PartiQLValueType#CLOB} | ||
* @return a value representing the applicable PartiQL value | ||
* @throws UnsupportedOperationException when this method is not applicable to the type returned by {@link PartiQLCursor#getType()} | ||
* @throws NullPointerException if this method is invoked when {@link PartiQLCursor#isNull()} returns true | ||
* @apiNote <b>! ! ! EXPERIMENTAL ! ! !</b> This is an experimental API under development by the PartiQL maintainers. | ||
* Please abstain from using this API until given notice otherwise. This may break between iterations without prior notice. | ||
*/ | ||
@NotNull | ||
public Clob getClob() throws UnsupportedOperationException, NullPointerException; |
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'm not sure these are necessary considering you can use getBytes()
. I would remove them for the time being so this package has to java.sql dependency.
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.
ACK. Just updated to remove for now.
/** | ||
* @return a basic implementation of {@link PartiQLValueLoader}. | ||
*/ | ||
static PartiQLValueLoader standard() { |
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.
Makes me wonder if we should be changing the 1.0 builder names ...
I'd like PartiQLCursor to exist -- however, after some thought, I'd like it to exist in another package (maybe |
Relevant Issues
Description
apiDump
. See the above linked PR for the original description.Other Information
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.