You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "lowka (via GitHub)" <gi...@apache.org> on 2025/08/25 08:22:00 UTC
[PR] IGNITE-26276 Sql. Jdbc. Add new implementation for ResultSetMetadata [ignite-3]
lowka opened a new pull request, #6474:
URL: https://github.com/apache/ignite-3/pull/6474
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26276 Sql. Jdbc. Add new implementation for ResultSetMetadata [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #6474:
URL: https://github.com/apache/ignite-3/pull/6474#discussion_r2297837097
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcResultSetMetadata.java:
##########
@@ -0,0 +1,223 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.jdbc2;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.ignite.internal.jdbc.JdbcConverterUtils;
+import org.apache.ignite.internal.jdbc.proto.event.JdbcColumnMeta;
+import org.apache.ignite.sql.ColumnMetadata;
+import org.apache.ignite.sql.ColumnMetadata.ColumnOrigin;
+import org.apache.ignite.sql.ColumnType;
+import org.apache.ignite.sql.ResultSetMetadata;
+
+/**
+ * JDBC result set metadata implementation.
+ */
+public class JdbcResultSetMetadata implements ResultSetMetaData {
+ private static final int COLUMN_DISPLAY_SIZE = 30;
+
+ private final List<ColumnMetadata> cols;
+
+ /**
+ * Constructor.
+ *
+ * @param metadata Metadata.
+ */
+ public JdbcResultSetMetadata(ResultSetMetadata metadata) {
+ if (metadata == null) {
+ throw new IllegalArgumentException("metadata");
+ }
+ this.cols = metadata.columns();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public int getColumnCount() throws SQLException {
+ return cols.size();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isAutoIncrement(int column) throws SQLException {
+ column(column);
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isCaseSensitive(int column) throws SQLException {
+ column(column);
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isSearchable(int column) throws SQLException {
+ column(column);
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isCurrency(int column) throws SQLException {
+ column(column);
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public int isNullable(int column) throws SQLException {
+ return column(column).nullable() ? columnNullable : columnNoNulls;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isSigned(int column) throws SQLException {
+ column(column);
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public int getColumnDisplaySize(int column) throws SQLException {
+ column(column);
+ return COLUMN_DISPLAY_SIZE;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getColumnLabel(int column) throws SQLException {
+ ColumnMetadata metadata = column(column);
+ return metadata.name();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String getColumnName(int column) throws SQLException {
+ ColumnMetadata metadata = column(column);
+ ColumnOrigin origin = metadata.origin();
+ // Compatibility with the existing driver
+ if (origin != null && origin.columnName() != null) {
Review Comment:
When the migration to Client API will be done,
This comment will make no sense and seems should be removed or behavior should be changed.
Let's add a TODO in all such places referring to IGNITE-26145
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26276 Sql. Jdbc. Add new implementation for ResultSetMetadata [ignite-3]
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka closed pull request #6474: IGNITE-26276 Sql. Jdbc. Add new implementation for ResultSetMetadata
URL: https://github.com/apache/ignite-3/pull/6474
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org