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

ARROW-3966 [Java] JDBC Column Metadata in Arrow Field Metadata #3134

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5af1b5b
Separating out the field-type creation from the field creation.
Dec 5, 2018
523387f
Updating the API to support an optional 'includeMetadata' field.
Dec 5, 2018
a78c770
Updating Javadocs.
Dec 5, 2018
da77cbe
Creating a configuration class for the JDBC-to-Arrow converter.
Dec 8, 2018
b270044
Updated validaton & documentation, and unit tests for the new JdbcToA…
Dec 8, 2018
df632e3
Updating the SQL tests to include JdbcToArrowConfig versions.
Dec 8, 2018
fe097c8
Merge branch 'jdbc-to-arrow-config' into jdbc-column-metadata
Dec 8, 2018
e34a9e7
Fixing formatting.
Dec 8, 2018
4f1260c
Adding documentation for public static VectorSchemaRoot sqlToArrow(Re…
Dec 8, 2018
8d6cf00
Documentation for public static VectorSchemaRoot sqlToArrow(Connectio…
Dec 8, 2018
b5b0cb1
Merge branch 'jdbc-to-arrow-config' into jdbc-column-metadata
Dec 8, 2018
68c91e7
Modifying the jdbcToArrowSchema and jdbcToArrowVectors methods to rec…
Dec 8, 2018
5bfd6a2
Merge branch 'jdbc-to-arrow-config' into jdbc-column-metadata
Dec 8, 2018
a6fb1be
Fixing function call
Dec 8, 2018
bb3165b
Updating the function calls to use the JdbcToArrowConfig versions.
Dec 8, 2018
7e9ce37
Merge branch 'jdbc-to-arrow-config' into jdbc-column-metadata
Dec 8, 2018
7b4527c
Test for the include-metadata flag in the configuration.
Dec 8, 2018
72d64cc
Affirming the field metadata is empty when the configuration excludes…
Dec 8, 2018
03091a8
Unit tests for including result set metadata.
Dec 8, 2018
881c6c8
Merge pull request #1 from apache/master
mikepigott Dec 9, 2018
1ceac9e
Merge branch 'master' into jdbc-column-metadata
Dec 9, 2018
d847ebc
Fixing file location
Dec 9, 2018
3b17c29
Merge pull request #2 from apache/master
mikepigott Dec 15, 2018
e5b19ee
Merge pull request #3 from apache/master
mikepigott Dec 30, 2018
789c8c8
Merge pull request #4 from apache/master
mikepigott Jan 30, 2019
509a1cc
Merge pull request #5 from apache/master
mikepigott Feb 3, 2019
4a6de86
Merge branch 'master' into jdbc-column-metadata
Feb 3, 2019
69022c2
ARROW-3966: Fixing merge.
Feb 3, 2019
2928513
ARROW-3966: Moving the metadata flag assignment into the builder.
Feb 3, 2019
cfb2ba6
ARROW-3966: Using a helper method for building a UTC calendar with ro…
Feb 3, 2019
cc6cc88
ARROW-3966: Using a 1:N loop instead of a 0:N-1 loop for fewer index …
Feb 3, 2019
65741a9
ARROW-3966: Code review feedback
Feb 5, 2019
e9a9b2b
Merge pull request #6 from apache/master
mikepigott Feb 6, 2019
7049c36
Merge branch 'master' into jdbc-column-metadata
Feb 6, 2019
02f2f34
ARROW-3966: Picking up lost change to support null calendars.
Feb 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ARROW-3966: Using a helper method for building a UTC calendar with ro…
…ot locale.
Mike Pigott committed Feb 3, 2019
commit cfb2ba68292a1390fd09bed70bc52fc827bd69fc
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;

import org.apache.arrow.memory.BaseAllocator;
import org.apache.arrow.memory.RootAllocator;
@@ -90,7 +88,7 @@ public static VectorSchemaRoot sqlToArrow(Connection connection, String query, B
Preconditions.checkNotNull(allocator, "Memory allocator object can not be null");

JdbcToArrowConfig config =
new JdbcToArrowConfig(allocator, Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ROOT), false);
new JdbcToArrowConfig(allocator, JdbcToArrowUtils.getUtcCalendar(), false);
return sqlToArrow(connection, query, config);
}

@@ -155,7 +153,7 @@ public static VectorSchemaRoot sqlToArrow(Connection connection, String query, J
public static VectorSchemaRoot sqlToArrow(ResultSet resultSet) throws SQLException, IOException {
Preconditions.checkNotNull(resultSet, "JDBC ResultSet object can not be null");

return sqlToArrow(resultSet, Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ROOT));
return sqlToArrow(resultSet, JdbcToArrowUtils.getUtcCalendar());
}

/**
@@ -172,7 +170,7 @@ public static VectorSchemaRoot sqlToArrow(ResultSet resultSet, BaseAllocator all
Preconditions.checkNotNull(allocator, "Memory Allocator object can not be null");

JdbcToArrowConfig config =
new JdbcToArrowConfig(allocator, Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ROOT), false);
new JdbcToArrowConfig(allocator, JdbcToArrowUtils.getUtcCalendar(), false);
return sqlToArrow(resultSet, config);
}

Original file line number Diff line number Diff line change
@@ -38,7 +38,9 @@
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;

import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.BaseFixedWidthVector;
@@ -108,6 +110,13 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, Calendar calendar
return jdbcToArrowSchema(rsmd, new JdbcToArrowConfig(new RootAllocator(0), calendar, false));
}

/**
* Returns the instance of a {java.util.Calendar} with the UTC time zone and root locale.
*/
public static Calendar getUtcCalendar() {
return Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ROOT);
}

/**
* Create Arrow {@link Schema} object for the given JDBC {@link ResultSetMetaData}.
*