[jira] [Created] (CALCITE-3322) There are two same testcase in RelMetadataTest

2019-09-03 Thread Hong Shen (Jira)
Hong Shen created CALCITE-3322:
--

 Summary: There are two same testcase in RelMetadataTest
 Key: CALCITE-3322
 URL: https://issues.apache.org/jira/browse/CALCITE-3322
 Project: Calcite
  Issue Type: Test
  Components: core
Affects Versions: 1.20.0
Reporter: Hong Shen


When I read the code, I found two identical testcases, except for the different 
names, which might need to be changed to limit 0, or just need to keep one.

  @Test public void testRowCountSortLimit() {
final String sql = "select * from emp order by ename limit 10";
checkRowCount(sql, 10d, 0D, 10d);
  }

  @Test public void testRowCountSortLimit0() {
final String sql = "select * from emp order by ename limit 10";
checkRowCount(sql, 10d, 0D, 10d);
  }




--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3298) Add getSelectivity for TableScan in RelMdSelectivity

2019-08-27 Thread Hong Shen (Jira)
Hong Shen created CALCITE-3298:
--

 Summary: Add getSelectivity for TableScan in RelMdSelectivity
 Key: CALCITE-3298
 URL: https://issues.apache.org/jira/browse/CALCITE-3298
 Project: Calcite
  Issue Type: Improvement
  Components: core
Affects Versions: 1.20.0
Reporter: Hong Shen


Now there is no getSelectivity for TableScan in RelMdSelectivity, I can add 
this function if needed. 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3291) SqlFunctionsTest failed

2019-08-25 Thread Hong Shen (Jira)
Hong Shen created CALCITE-3291:
--

 Summary: SqlFunctionsTest failed
 Key: CALCITE-3291
 URL: https://issues.apache.org/jira/browse/CALCITE-3291
 Project: Calcite
  Issue Type: Test
  Components: core
Reporter: Hong Shen


When I run mvn test, I find some testcase failed.

{code}

[ERROR] Tests run: 39, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.017 
s <<< FAILURE! - in org.apache.calcite.test.SqlFunctionsTest

[ERROR] testMd5(org.apache.calcite.test.SqlFunctionsTest)  Time elapsed: 0.009 
s  <<< ERROR!

java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of 
org/apache/calcite/runtime/SqlFunctions.md5 must not be null

 at org.apache.calcite.test.SqlFunctionsTest.testMd5(SqlFunctionsTest.java:882)

 

[ERROR] testSha1(org.apache.calcite.test.SqlFunctionsTest)  Time elapsed: 0.007 
s  <<< ERROR!

java.lang.IllegalArgumentException: Argument for @Nonnull parameter 'string' of 
org/apache/calcite/runtime/SqlFunctions.sha1 must not be null

 at org.apache.calcite.test.SqlFunctionsTest.testSha1(SqlFunctionsTest.java:896)

{/code}

The code is

{code}
   @Test public void testMd5() {
assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5("")));
assertThat("d41d8cd98f00b204e9800998ecf8427e", is(md5(ByteString.of("", 
16;
assertThat("902fbdd2b1df0c4f70b4a5d23525e932", is(md5("ABC")));
assertThat("902fbdd2b1df0c4f70b4a5d23525e932",
is(md5(new ByteString("ABC".getBytes(UTF_8);
try {
  String o = md5((String) null);
  fail("Expected NPE, got " + o);
} catch (NullPointerException e) {
  // ok
}
  }
{/code}

It should catch java.lang.IllegalArgumentException, but not 
NullPointerException. I will add a patch to fix it.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3287) Union's getRowCount in RelMdRowCount has not concern 'union all'

2019-08-23 Thread Hong Shen (Jira)
Hong Shen created CALCITE-3287:
--

 Summary: Union's getRowCount in RelMdRowCount has not concern 
'union all'
 Key: CALCITE-3287
 URL: https://issues.apache.org/jira/browse/CALCITE-3287
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Hong Shen


when I read the RelMdRowCount.java, I found that union's getRowCount has not 
concern 'union all', while in Union.estimateRowCount has. can any body tell me 
why?



--
This message was sent by Atlassian Jira
(v8.3.2#803003)