-
Notifications
You must be signed in to change notification settings - Fork 40
ResultSchema refactor #978
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
Merged
sreekanth-db
merged 4 commits into
databricks:main
from
sreekanth-db:result-schema-refactor
Sep 5, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
src/main/java/com/databricks/jdbc/model/core/ColumnInfo.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| package com.databricks.jdbc.model.core; | ||
|
|
||
| import com.databricks.sdk.support.ToStringer; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Column info POJO | ||
| * | ||
| * <p>TODO: Replace this class with the corresponding SDK implementation once it becomes available | ||
| */ | ||
| public class ColumnInfo { | ||
| @JsonProperty("name") | ||
| private String name; | ||
|
|
||
| @JsonProperty("position") | ||
| private Long position; | ||
|
|
||
| @JsonProperty("type_interval_type") | ||
| private String typeIntervalType; | ||
|
|
||
| @JsonProperty("type_name") | ||
| private ColumnInfoTypeName typeName; | ||
|
|
||
| @JsonProperty("type_precision") | ||
| private Long typePrecision; | ||
|
|
||
| @JsonProperty("type_scale") | ||
| private Long typeScale; | ||
|
|
||
| @JsonProperty("type_text") | ||
| private String typeText; | ||
|
|
||
| public ColumnInfo setName(String name) { | ||
| this.name = name; | ||
| return this; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return this.name; | ||
| } | ||
|
|
||
| public ColumnInfo setPosition(Long position) { | ||
| this.position = position; | ||
| return this; | ||
| } | ||
|
|
||
| public Long getPosition() { | ||
| return this.position; | ||
| } | ||
|
|
||
| public ColumnInfo setTypeIntervalType(String typeIntervalType) { | ||
| this.typeIntervalType = typeIntervalType; | ||
| return this; | ||
| } | ||
|
|
||
| public String getTypeIntervalType() { | ||
| return this.typeIntervalType; | ||
| } | ||
|
|
||
| public ColumnInfo setTypeName(ColumnInfoTypeName typeName) { | ||
| this.typeName = typeName; | ||
| return this; | ||
| } | ||
|
|
||
| public ColumnInfoTypeName getTypeName() { | ||
| return this.typeName; | ||
| } | ||
|
|
||
| public ColumnInfo setTypePrecision(Long typePrecision) { | ||
| this.typePrecision = typePrecision; | ||
| return this; | ||
| } | ||
|
|
||
| public Long getTypePrecision() { | ||
| return this.typePrecision; | ||
| } | ||
|
|
||
| public ColumnInfo setTypeScale(Long typeScale) { | ||
| this.typeScale = typeScale; | ||
| return this; | ||
| } | ||
|
|
||
| public Long getTypeScale() { | ||
| return this.typeScale; | ||
| } | ||
|
|
||
| public ColumnInfo setTypeText(String typeText) { | ||
| this.typeText = typeText; | ||
| return this; | ||
| } | ||
|
|
||
| public String getTypeText() { | ||
| return this.typeText; | ||
| } | ||
|
|
||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } else if (o != null && this.getClass() == o.getClass()) { | ||
| ColumnInfo that = (ColumnInfo) o; | ||
| return Objects.equals(this.name, that.name) | ||
| && Objects.equals(this.position, that.position) | ||
| && Objects.equals(this.typeIntervalType, that.typeIntervalType) | ||
| && Objects.equals(this.typeName, that.typeName) | ||
| && Objects.equals(this.typePrecision, that.typePrecision) | ||
| && Objects.equals(this.typeScale, that.typeScale) | ||
| && Objects.equals(this.typeText, that.typeText); | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| public int hashCode() { | ||
| return Objects.hash( | ||
| new Object[] { | ||
| this.name, | ||
| this.position, | ||
| this.typeIntervalType, | ||
| this.typeName, | ||
| this.typePrecision, | ||
| this.typeScale, | ||
| this.typeText | ||
| }); | ||
| } | ||
|
|
||
| public String toString() { | ||
| return (new ToStringer(ColumnInfo.class)) | ||
| .add("name", this.name) | ||
| .add("position", this.position) | ||
| .add("typeIntervalType", this.typeIntervalType) | ||
| .add("typeName", this.typeName) | ||
| .add("typePrecision", this.typePrecision) | ||
| .add("typeScale", this.typeScale) | ||
| .add("typeText", this.typeText) | ||
| .toString(); | ||
| } | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
src/main/java/com/databricks/jdbc/model/core/ColumnInfoTypeName.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.databricks.jdbc.model.core; | ||
|
|
||
|
sreekanth-db marked this conversation as resolved.
|
||
| /** | ||
| * Column info type name POJO | ||
| * | ||
| * <p>TODO: Replace this class with the corresponding SDK implementation once it becomes available | ||
| */ | ||
| public enum ColumnInfoTypeName { | ||
| ARRAY, | ||
| BINARY, | ||
| BOOLEAN, | ||
| BYTE, | ||
| CHAR, | ||
| DATE, | ||
| DECIMAL, | ||
| DOUBLE, | ||
| FLOAT, | ||
| GEOGRAPHY, | ||
| GEOMETRY, | ||
| INT, | ||
| INTERVAL, | ||
| LONG, | ||
| MAP, | ||
| NULL, | ||
| SHORT, | ||
| STRING, | ||
| STRUCT, | ||
| TIMESTAMP, | ||
| USER_DEFINED_TYPE; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/com/databricks/jdbc/model/core/ResultSchema.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package com.databricks.jdbc.model.core; | ||
|
|
||
| import com.databricks.sdk.support.ToStringer; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.util.Collection; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Result schema POJO | ||
| * | ||
| * <p>TODO: Replace this class with the corresponding SDK implementation once it becomes available | ||
| */ | ||
| public class ResultSchema { | ||
| @JsonProperty("column_count") | ||
| private Long columnCount; | ||
|
|
||
| @JsonProperty("columns") | ||
| private Collection<ColumnInfo> columns; | ||
|
|
||
| public ResultSchema setColumnCount(Long columnCount) { | ||
| this.columnCount = columnCount; | ||
| return this; | ||
| } | ||
|
|
||
| public Long getColumnCount() { | ||
| return this.columnCount; | ||
| } | ||
|
|
||
| public ResultSchema setColumns(Collection<ColumnInfo> columns) { | ||
| this.columns = columns; | ||
| return this; | ||
| } | ||
|
|
||
| public Collection<ColumnInfo> getColumns() { | ||
| return this.columns; | ||
| } | ||
|
|
||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } else if (o != null && this.getClass() == o.getClass()) { | ||
| ResultSchema that = (ResultSchema) o; | ||
| return Objects.equals(this.columnCount, that.columnCount) | ||
| && Objects.equals(this.columns, that.columns); | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| public int hashCode() { | ||
| return Objects.hash(new Object[] {this.columnCount, this.columns}); | ||
| } | ||
|
|
||
| public String toString() { | ||
| return (new ToStringer(ResultSchema.class)) | ||
| .add("columnCount", this.columnCount) | ||
| .add("columns", this.columns) | ||
| .toString(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.