python: fix generated table name in dataframe creation (#1078)

This commit is contained in:
QP Hou
2021-10-11 21:50:43 -07:00
committed by GitHub
parent 668775fdf8
commit 91a677c074
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -83,8 +83,9 @@ impl ExecutionContext {
errors::wrap(MemTable::try_new(partitions[0][0].schema(), partitions))?;
// generate a random (unique) name for this table
let name = rand::thread_rng()
.sample_iter(&Alphanumeric)
// table name cannot start with numeric digit
let name = std::iter::once('c')
.chain(rand::thread_rng().sample_iter(&Alphanumeric))
.take(10)
.collect::<String>();