Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

[TRAFODION-2079]Catalog API support get indexes - #594

Merged
asfgit merged 5 commits into
masterfrom
unknown repository
Aug 5, 2016
Merged

[TRAFODION-2079]Catalog API support get indexes#594
asfgit merged 5 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jul 15, 2016

Copy link
Copy Markdown

After this comment, both JDBC type4 and ODBC Catalog API will support
get the information about index.
[TRAFODION-2079]([3rd party tool-Squirrel] indexes won't show up on
objects panel, sql command line works fine) which related to Catalog
API of JDBC type, it is fixed also.

After this comment, both JDBC type4 and ODBC Catalog API will support
get the information about index.
[TRAFODION-2079]([3rd party tool-Squirrel] indexes won't show up on
objects panel, sql command line works fine) which related to Catalog
API of JDBC type, it is fixed also.
@Traf-Jenkins

Copy link
Copy Markdown

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/916/

@Traf-Jenkins

Copy link
Copy Markdown

"cast(3 as smallint) TYPE, "
"cast(0 as smallint) ORDINAL_POSITION, "
"cast('' as varchar(128)) COLUMN_NAME, "
"cast('' as char(1)) ASC_OR_DES, "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec says NULL should be returned when the value is not available. Can you please change it to NULL. Attaching a formatted output of this query when the table has index would be helpful to validate the results of the query by the reviewers. Consider creating a use case with two tables one with update statistics performed and another without.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to null. I will add the test to ODBC test.
I think I still need add some new JDBC test. I will take some days.

@Traf-Jenkins

Copy link
Copy Markdown

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/989/

@Traf-Jenkins

Copy link
Copy Markdown

@Traf-Jenkins

Copy link
Copy Markdown

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/993/

@Traf-Jenkins

Copy link
Copy Markdown

@Traf-Jenkins

Copy link
Copy Markdown

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/999/

@Traf-Jenkins

Copy link
Copy Markdown

@ryzuo

ryzuo commented Aug 3, 2016

Copy link
Copy Markdown
Contributor

This looks good to me.

assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbAscOrDesc ", indexInfo.dbAscOrDesc, rs.getString("ASC_OR_DESC"));
assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbCardinality ", indexInfo.dbCardinality, rs.getInt("CARDINALITY"));
assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbPages ", indexInfo.dbPages, rs.getInt("PAGES"));
assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbFilterCondition ", indexInfo.dbFilterCondition, rs.getString("FILTER_CONDITION"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like value 0 is being compared with SQL value of null in case of numeric columns. Should we use wasNull() method to check if the column returned was really null.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the JDBC document, getInt() return 0 when the column is NULL, So I don't check wasNull().
However, it good to check more in the test case, I will add some the code that check the wasNull().

@Traf-Jenkins

Copy link
Copy Markdown

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/1020/

@Traf-Jenkins

Copy link
Copy Markdown

@Traf-Jenkins

Copy link
Copy Markdown

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/1021/

@Traf-Jenkins

Copy link
Copy Markdown

assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbTableName ", indexInfo.dbTableName, rs.getString("TABLE_NAME"));
assertEquals(methondName + " rowNum " + Integer.toString(rowNum) + " dbNoneUnique ", indexInfo.dbNoneUnique, rs.getBoolean("NON_UNIQUE"));
// By the Document, dbNoneUnique will return null if the type is SQL_TABLE_STAT
System.out.println(rs.wasNull());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed to display the wasNull. Where will the output go in Jenkins environment

@selvaganesang

Copy link
Copy Markdown
Contributor

+1

1 similar comment
@sureshsubbiah

Copy link
Copy Markdown
Contributor

+1

@sureshsubbiah

Copy link
Copy Markdown
Contributor

Merging with the assumption that any testware change due to the last comment by @selvaganesang can be addressed later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants