Skip to content

Commit 8d90242

Browse files
King-OzymandiasKing-Ozymandias
authored andcommitted
Update readme for column mapping
1 parent 178bab5 commit 8d90242

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ df writeToSqlite: conn tableName: 'table'.
144144
```st
145145
df writeToSqlite: conn tableName: 'table' columnNames: #('col1' 'col2' 'col3').
146146
```
147+
#### Mapping (selecting / renaming dataframe columns):
148+
Let's assume:
149+
- CREATE TABLE tbl (a,b,c)
150+
- DataFrame with columns (a,x,c,d)
151+
- We want to write:
152+
- a to a
153+
- x to b
154+
- c to c
155+
- ignore d
156+
- NB: no mention of column d, order is irrelevant
157+
```st
158+
df writeToSqlite: conn tableName: 'table' columnMappings: { #c. #x -> #b. #a }.
159+
```
147160

148161
## Documentation and Literature
149162

0 commit comments

Comments
 (0)