opensearch-project / opensearch-project/sql-jdbc

[BUG] No corresponding type for geo_point in JDBC driver

Open
#31 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
28
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

JDBC driver throws NPE when result set includes fields of geo_point type. This seems caused by no mapping for geo_point type in https://github.com/opensearch-project/sql/blob/develop/sql-jdbc/src/main/java/org/opensearch/jdbc/types/OpenSearchType.java#L70.

The missing info can also be seen in user manual: https://github.com/opensearch-project/sql/blob/main/docs/user/general/datatypes.rst#data-types-mapping

To Reproduce
Steps to reproduce the behavior:

  1. Create the data flights sample index by OpenSearch Dashboards
  2. Run the query SELECT * FROM opensearch_dashboards_sample_data_flights
  3. See error

Expected behavior
Expect JDBC driver can handle properly and display geo point field values well as others.

Screenshots

Screen Shot 2021-06-01 at 12 06 57 PM

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Error logs in JDBC driver:

2021-06-01 11:55:55.139 FINE   336 [ExecutorRunner-pool-2-thread-2 - d.i] Error (java.lang.NullPointerException) getting value for: 92/3 (java.lang.String: OriginLocation): java.lang.NullPointerException
2021-06-01 11:55:55.139 FINE   336 [ExecutorRunner-pool-2-thread-2 - d.i] 
java.lang.NullPointerException
	at org.opensearch.jdbc.ResultSetImpl.getObjectX(ResultSetImpl.java:600)
	at org.opensearch.jdbc.ResultSetImpl.getObjectX(ResultSetImpl.java:594)
	at org.opensearch.jdbc.ResultSetImpl.getStringX(ResultSetImpl.java:224)
	at org.opensearch.jdbc.ResultSetImpl.getString(ResultSetImpl.java:218)
	at com.onseven.dbvis.jdbc.c.d.c(Z:2630)
	at com.onseven.dbvis.jdbc.c.d.i(Z:2996)
	at com.onseven.dbvis.l.f.x.b(Z:848)
	at com.onseven.dbvis.l.f.x.b(Z:3226)
	at com.onseven.dbvis.l.f.l.c(Z:3200)
	at com.onseven.dbvis.l.f.l.b(Z:268)
	at com.onseven.dbvis.l.f.l.d(Z:2456)
	at com.onseven.dbvis.l.f.l.qe(Z:2750)
	at com.onseven.dbvis.l.f.r.qe(Z:2062)
	at com.onseven.dbvis.l.f.cb.ie(Z:236)
	at com.onseven.dbvis.l.f.cb.sd(Z:3158)
	at com.onseven.dbvis.l.f.c.b.b.n.f(Z:161)
	at com.onseven.dbvis.l.f.c.b.b.n.b(Z:1848)
	at com.onseven.dbvis.l.f.c.b.b.n.eb(Z:2399)
	at com.onseven.dbvis.l.f.c.b.m.q(Z:731)
	at com.onseven.dbvis.l.f.c.g.b(Z:1641)
	at com.onseven.dbvis.l.f.c.g.hb(Z:2642)
	at com.onseven.dbvis.l.f.c.g.qe(Z:2732)
	at com.onseven.dbvis.l.f.cb.ie(Z:236)
	at com.onseven.dbvis.l.f.m.c(Z:1374)
	at com.onseven.dbvis.l.f.m.doInBackground(Z:1521)
	at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the geo_point mapping location in sql-jdbc/src/main/java/org/opensearch/jdbc/types/OpenSearchType.java and review the related mapping in docs/user/general/datatypes.rst. Reproduce the issue with the flights sample index and SELECT * query, then verify the JDBC driver handles geo_point values without the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.