You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/26 13:29:53 UTC

[GitHub] [arrow-datafusion] alamb opened a new issue #176: Why does DataFusion throw a Tokio 0.2 runtime error?

alamb opened a new issue #176:
URL: https://github.com/apache/arrow-datafusion/issues/176


   *Note*: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-11578
   
   thread 'tests::simple_join' panicked at 'must be called from the context of a Tokio 0.2.x runtime configured with either `basic_scheduler` or `threaded_scheduler`'.
   
   {code:Rust}
       #[tokio::test]
       async fn simple_join() -> Result<()> {
           let schema1 = Arc::new(Schema::new(vec![
               Field::new("a", DataType::Utf8, false),
               Field::new("b", DataType::Int32, false),
           ]));
           let schema2 = Arc::new(Schema::new(vec![
               Field::new("c", DataType::Utf8, false),
               Field::new("d", DataType::Int32, false),
           ]));
   
           // define data.
           let batch1 = RecordBatch::try_new(
               schema1.clone(),
               vec![
                   Arc::new(StringArray::from(vec!["a", "b", "c", "d"])),
                   Arc::new(Int32Array::from(vec![1, 10, 10, 100])),
               ],
           )?;
           // define data.
           let batch2 = RecordBatch::try_new(
               schema2.clone(),
               vec![
                   Arc::new(StringArray::from(vec!["a", "b", "c", "d"])),
                   Arc::new(Int32Array::from(vec![1, 10, 10, 100])),
               ],
           )?;
   
           let mut ctx = ExecutionContext::new();
   
           let table1 = MemTable::try_new(schema1, vec![vec![batch1]])?;
           let table2 = MemTable::try_new(schema2, vec![vec![batch2]])?;
   
           ctx.register_table("t1", Box::new(table1));
           ctx.register_table("t2", Box::new(table2));
   
           let sql = concat!(
               "SELECT a, b, d ",
               "FROM t1 JOIN t2 ON a = c ",
               "ORDER BY b ASC ",
               "LIMIT 3"
           );
   
           let plan = ctx.create_logical_plan(&sql)?;
           let plan = ctx.optimize(&plan)?;
           let plan = ctx.create_physical_plan(&plan)?;
   
           let batches = collect(plan).await?;
           let formatted = arrow::util::pretty::pretty_format_batches(&batches).unwrap();
           let actual_lines: Vec<&str> = formatted.trim().lines().collect();
   
           let expected = vec![
               "+---+----+----+",
               "| a | b  | d  |",
               "+---+----+----+",
               "| a | 1  | 1  |",
               "| b | 10 | 10 |",
               "| c | 10 | 10 |",
               "+---+----+----+",
           ];
   
           assert_eq!(expected, actual_lines);
   
           Ok(())
       }
   {code}
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #176: Why does DataFusion throw a Tokio 0.2 runtime error?

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #176:
URL: https://github.com/apache/arrow-datafusion/issues/176#issuecomment-1028382212


   I don't think this is relevant anymore


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on issue #176: Why does DataFusion throw a Tokio 0.2 runtime error?

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #176:
URL: https://github.com/apache/arrow-datafusion/issues/176#issuecomment-826840874


   DataFusion now requires tokio 1.x so if you tried to run this program using tokio 0.2 you'll get some sort of strange runtime error 


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb closed issue #176: Why does DataFusion throw a Tokio 0.2 runtime error?

Posted by GitBox <gi...@apache.org>.
alamb closed issue #176:
URL: https://github.com/apache/arrow-datafusion/issues/176


   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org