Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model column mapping #375

Merged
merged 1 commit into from
May 2, 2024
Merged

Model column mapping #375

merged 1 commit into from
May 2, 2024

Conversation

ea-rus
Copy link
Contributor

@ea-rus ea-rus commented May 2, 2024

Mapping columns to model in joins

In this example

select * from db.table1 t
join my_model m on t.a = m.x

If table1 has:

a | b | c 
---------
1 | 2 | 3 

Column 'a' will be renamed to 'x' and my_model will receive input:

x | b | c 
---------
1 | 2 | 3 

Related to mindsdb/mindsdb#4576

@ea-rus ea-rus changed the title model column mapping Model column mapping May 2, 2024
@ea-rus ea-rus mentioned this pull request May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
mindsdb_sql
   __about__.py10100%1–10
   __init__.py1292283%43, 47, 93, 110, 134–153, 160–161, 178
mindsdb_sql/parser
   lexer.py165199%243
   logger.py19479%14, 17, 23, 26
   parser.py4563193%48, 53, 73, 77, 81, 87, 91–93, 121–128, 182, 199, 249, 253, 317, 346–347, 367, 378, 491, 526, 557, 567, 581, 657
   utils.py46491%73–79
mindsdb_sql/parser/ast
   base.py36781%13, 28, 31, 49–52
   create.py701086%7–8, 21, 26, 89–94
   drop.py52296%10, 13
   insert.py62592%32, 35–37, 42
   show.py48198%18
   update.py53591%40–42, 75–76
mindsdb_sql/parser/ast/select
   case.py26292%19, 22
   constant.py36197%23
   data.py11282%15, 19
   identifier.py64789%43, 80–85
   native_query.py13192%25
   operation.py121794%27–30, 56, 65, 166, 185
   parameter.py11191%10
   select.py97397%148–153
   star.py12283%8–9
   union.py23196%18
mindsdb_sql/parser/dialects/mindsdb
   knowledge_base.py46198%79
   lexer.py2552192%336, 338, 340, 352, 354, 356, 362–380
   parser.py9512597%120, 124, 263, 288, 385, 571, 588, 612–613, 769, 823, 900, 1029, 1039, 1077–1078, 1103, 1114, 1250, 1303, 1731, 1739, 1792–1795
mindsdb_sql/parser/dialects/mysql
   lexer.py23674%16, 18, 20, 32, 34, 36
   parser.py6092496%131, 133, 226–227, 326, 356, 373, 423, 427, 501, 511, 549–550, 570, 581, 702, 730, 735–737, 741, 758, 902, 1046
   show_index.py171135%10–12, 15–23, 26–27
mindsdb_sql/planner
   plan_join.py2981396%138, 176, 185, 212, 216, 305, 353, 371, 380–381, 430, 440, 442
   plan_join_ts.py1791094%53, 60, 83–84, 129, 181, 185, 193, 268, 335
   query_plan.py22864%13–21, 30
   query_planner.py3876384%41–42, 65–66, 75, 152, 175, 380, 408–486, 529–530, 543, 569, 631, 661, 689, 714–716
   query_prepare.py2846179%76, 78, 86–116, 227, 249, 272, 315, 336, 360, 389–443, 446–452, 483, 496–498, 507, 526
   step_result.py14286%7, 12
   steps.py1812288%14, 19, 27, 32–34, 55–60, 67–73, 110–115
   ts_utils.py67691%59, 61, 83–86, 90
   utils.py2422789%60, 106, 112, 127, 139, 151, 154, 166, 196, 209, 224, 230, 235, 242, 244, 249, 262, 267, 273, 279, 293, 310, 340–341, 352–353, 368
mindsdb_sql/render
   sqlalchemy_render.py4247782%53, 87, 89, 101, 106, 123, 125, 127, 129, 191, 194–195, 208–209, 220–221, 239, 269, 271, 300, 314, 320, 371, 434–445, 456–460, 490, 505, 510–520, 529–530, 554–565, 584, 607–631, 653, 659, 681–684, 704–707
TOTAL641650692% 

Tests Skipped Failures Errors Time
670 1 💤 0 ❌ 0 🔥 22.314s ⏱️

@ea-rus ea-rus mentioned this pull request May 2, 2024
11 tasks
@ea-rus ea-rus merged commit 7c731a1 into staging May 2, 2024
8 checks passed
@ea-rus ea-rus deleted the model-col-map branch October 31, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant