question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I want to specify which fields to include in my joined table

See original GitHub issue

Description: What is it?

When I join an explore, I want to be able to specify which fields are available in the joined table in my explore.

E.g. if I join organizations to users, I only want organization_id and organization_name to appear in the joined organizations table in my users explore.

Problem: What problem does this solve?

only some of the columns from my joined table may be relevant to join to my other table.

What: Roughly, what does this look like in the product?

  • in the YAML file, there’s a way to include-fields or something in the join.

e.g.

models:
- name: my_model
  description: 
  meta:
    joins:
    - join: other_model
      sql_on: ${my_model.id} = ${other_model.id}
      include_fields: ['users', 'user_id', 'test']

By default, include_fields is set to all

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JohnRomanskicommented, May 27, 2022

include_fields should also be able to be set to none [] in the case that you are using a table as a join-through for a many to many relation. (Product A joins ProductCategory B joins Category C.) ProductCategory B values would only be foreign keys to A and C and have no value for the user on the front end at all.

1reaction
TuringLovesDeathMetalcommented, Oct 27, 2022

become more blurred

oh boy - soon the modern data stack 🥞 will be the modern data porridge 🥣

Read more comments on GitHub >

github_iconTop Results From Across the Web

Join Field (Data Management)—ArcGIS Pro | Documentation
Specifies how joining fields and field types will be transferred to the output. Select transfer fields—Fields and field types from the joined table...
Read more >
SQL joins and how to use them - Launch School
Types of Joins ... As mentioned earlier, a JOIN statement can come in various forms. To specify which type of join to use,...
Read more >
How to best explain on what fields should a user join on?
Simply put, look for the columns with values that match between the tables/views.
Read more >
Join tables and queries - Microsoft Support
Use joins in Access queries to combine records from different data sources so that each pair of records from the sources becomes one...
Read more >
Create a Join That's Based on a Comparison Other than Equality
Drag the fields you'd like to include in your query to the query grid. Make sure to include the field that will link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found