You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Min-Seok Kim (Jira)" <ji...@apache.org> on 2023/05/19 06:56:00 UTC

[jira] [Updated] (CALCITE-5712) FilterableTable with Kotlin coroutine and logback fails.

     [ https://issues.apache.org/jira/browse/CALCITE-5712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Min-Seok Kim updated CALCITE-5712:
----------------------------------
    Description: 
The MyFilterableTable class is not functioning properly when used in conjunction with coroutines (kotest) and logback. The issue can be reproduced by following the steps outlined in the GitHub repository provided: [https://github.com/emesday/filterabletable-coroutine/blob/main/src/test/kotlin/MinimalTest.kt]

 

 
{code:java}
class MyFilterableTable : AbstractTable(), FilterableTable {
    override fun getRowType(typeFactory: RelDataTypeFactory): RelDataType {
        return typeFactory.createStructType(
            listOf(typeFactory.createSqlType(SqlTypeName.BIGINT), typeFactory.createSqlType(SqlTypeName.VARCHAR)),
            listOf("ID", "NAME")
        )
    }    override fun scan(root: DataContext?, filters: MutableList<RexNode>?): Enumerable<Array<Any?>> {
        return Linq4j.asEnumerable(arrayOf(arrayOf(1L, "John")))
    }
}
{code}
*Steps to Reproduce:*
 # Clone the GitHub repository [https://github.com/emesday/filterabletable-coroutine]
 # USE_LOGBACK=true ./gradlew test -i

this executes MinimalTest in src/test/kotlin/MinimalTest.kt

*Expected Behavior:* 

The MyFilterableTable class should work correctly with coroutines (kotest) and logback.

*Actual Behavior:* 

The MyFilterableTable class fails to function as expected when used in combination with coroutines (kotest) and logback.

 
{code:java}
MinimalTest > MyFilterableTable fails FAILED
    java.lang.AssertionError: RelSubset [rel#78:RelSubset#2.ENUMERABLE.[]] has wrong best cost {130.0 rows, 216.0 cpu, 0.0 io}. Correct cost is {150.5 rows, 150.505 cpu, 0.0 io}
        at org.apache.calcite.util.Litmus.lambda$static$0(Litmus.java:31) {code}
 

 

 

 

 

  was:
The MyFilterableTable class is not functioning properly when used in conjunction with coroutines (kotest) and logback. The issue can be reproduced by following the steps outlined in the GitHub repository provided: [https://github.com/emesday/filterabletable-coroutine/blob/main/src/test/kotlin/MinimalTest.kt]

 

 
{code:java}
class MyFilterableTable : AbstractTable(), FilterableTable {
    override fun getRowType(typeFactory: RelDataTypeFactory): RelDataType {
        return typeFactory.createStructType(
            listOf(typeFactory.createSqlType(SqlTypeName.BIGINT), typeFactory.createSqlType(SqlTypeName.VARCHAR)),
            listOf("ID", "NAME")
        )
    }    override fun scan(root: DataContext?, filters: MutableList<RexNode>?): Enumerable<Array<Any?>> {
        return Linq4j.asEnumerable(arrayOf(arrayOf(1L, "John")))
    }
}
{code}
 

 

Steps to Reproduce:
 # Clone the GitHub repository [https://github.com/emesday/filterabletable-coroutine]
 # USE_LOGBACK=true ./gradlew test -i

this executes 

 

 


> FilterableTable with Kotlin coroutine and logback fails.
> --------------------------------------------------------
>
>                 Key: CALCITE-5712
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5712
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Min-Seok Kim
>            Priority: Major
>
> The MyFilterableTable class is not functioning properly when used in conjunction with coroutines (kotest) and logback. The issue can be reproduced by following the steps outlined in the GitHub repository provided: [https://github.com/emesday/filterabletable-coroutine/blob/main/src/test/kotlin/MinimalTest.kt]
>  
>  
> {code:java}
> class MyFilterableTable : AbstractTable(), FilterableTable {
>     override fun getRowType(typeFactory: RelDataTypeFactory): RelDataType {
>         return typeFactory.createStructType(
>             listOf(typeFactory.createSqlType(SqlTypeName.BIGINT), typeFactory.createSqlType(SqlTypeName.VARCHAR)),
>             listOf("ID", "NAME")
>         )
>     }    override fun scan(root: DataContext?, filters: MutableList<RexNode>?): Enumerable<Array<Any?>> {
>         return Linq4j.asEnumerable(arrayOf(arrayOf(1L, "John")))
>     }
> }
> {code}
> *Steps to Reproduce:*
>  # Clone the GitHub repository [https://github.com/emesday/filterabletable-coroutine]
>  # USE_LOGBACK=true ./gradlew test -i
> this executes MinimalTest in src/test/kotlin/MinimalTest.kt
> *Expected Behavior:* 
> The MyFilterableTable class should work correctly with coroutines (kotest) and logback.
> *Actual Behavior:* 
> The MyFilterableTable class fails to function as expected when used in combination with coroutines (kotest) and logback.
>  
> {code:java}
> MinimalTest > MyFilterableTable fails FAILED
>     java.lang.AssertionError: RelSubset [rel#78:RelSubset#2.ENUMERABLE.[]] has wrong best cost {130.0 rows, 216.0 cpu, 0.0 io}. Correct cost is {150.5 rows, 150.505 cpu, 0.0 io}
>         at org.apache.calcite.util.Litmus.lambda$static$0(Litmus.java:31) {code}
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)