8000 python: fix generated table name in dataframe creation (#1078) · tfeda/datafusion-python@fa43a80 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa43a80

Browse files
QP Houjimexist
QP Hou
authored andcommitted
python: fix generated table name in dataframe creation (#1078)
GitOrigin-RevId: 91a677c074e968be21fa4ef304de4b918dbb5a92
1 parent 3ddc3c3 commit fa43a80

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ impl ExecutionContext {
8383
errors::wrap(MemTable::try_new(partitions[0][0].schema(), partitions))?;
8484

8585
// generate a random (unique) name for this table
86-
let name = rand::thread_rng()
87-
.sample_iter(&Alphanumeric)
86+
// table name cannot start with numeric digit
87+
let name = std::iter::once('c')
88+
.chain(rand::thread_rng().sample_iter(&Alphanumeric))
8889
.take(10)
8990
.collect::<String>();
9091

0 commit comments

Comments
 (0)
0