How do I get started with MySQL Dataflows?
Hello all, I have roughly two years experience with creating Magic ETLs, but no experience with MySQL dataflows. I'm seeking to experiment with MySQL just for the sake of experimentation.
Background: I've written thousands of Case When Statements for Beast Modes and calculated fields, but have very little actual SQL experience outside of that.
I know I have to input two or more datasets then apply some sort of join in the transform, but I don't know exactly what all to do in between.
For example, I have no idea whether I should index each table individually in the input dataset, or index afterwards in the join transform.
For simplicity, assume I have a table1 and table2. I want to left join table2 onto table1; joining on 'Name', 'Year', and 'Type'.
What would the indexing look like in this scenario?
Best Answers
-
@TheScotsman To start, I would suggest learning more about SQL (specifically SELECT statements). Here is a good tutorial to get you started on the basics: . You can also learn more about MySQL Domo dataflows here:
While knowledge of SQL is definitely helpful, unless you have a pressing reason to use MySQL dataflows (complex joins, etc.) you are likely better off sticking with MagicETL since there are some significant performance gains.
1 -
It might be having a problem with aliasing - using asterisk. Asterisk is a representation for all.
SELECT
s.Name AS State_Name,
s.Year AS State_Year,
s.Gender AS State_Gender,
s.Id AS State_Id,
n.Count AS National_Count
FROM state_names s
LEFT OUTER JOIN national_names n
ON s.Name = n.Name
AND s.Year = n.Year
AND s.Gender = n.Gender;** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Answers
-
@TheScotsman To start, I would suggest learning more about SQL (specifically SELECT statements). Here is a good tutorial to get you started on the basics: . You can also learn more about MySQL Domo dataflows here:
While knowledge of SQL is definitely helpful, unless you have a pressing reason to use MySQL dataflows (complex joins, etc.) you are likely better off sticking with MagicETL since there are some significant performance gains.
1 -
I tried to mimic what I did in a Magic ETL (nothing is wrong in that ouput dataset). On the MySQL dataflow, the National_Count column is coming in null on the preview. I tried executing the dataflow and it wouldn't run due to a "duplicate entry". For reference, the two datasets (US Baby Names) can be found at
What's wrong with the following code:SELECT
s.Name asState_Name
,
s.Year asState_Year
,
s.Gender ASState_Gender
,
s.Id asState_Id
,
s.*,
n.Count asNational_Count
FROMstate_names
s
LEFT OUTER JOINnational_names
n
ON
s.Name = n.Name AND s.Year = n.Year AND s.Gender = n.Gender;0 -
It might be having a problem with aliasing - using asterisk. Asterisk is a representation for all.
SELECT
s.Name AS State_Name,
s.Year AS State_Year,
s.Gender AS State_Gender,
s.Id AS State_Id,
n.Count AS National_Count
FROM state_names s
LEFT OUTER JOIN national_names n
ON s.Name = n.Name
AND s.Year = n.Year
AND s.Gender = n.Gender;** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Sorry…I should have expanded on that. You say it gave a duplicate entry. When you give it an explicit list (stating each one) such as s.Name, s.Year….
and then you also include s.* you are repeating yourself. s.Name, s.Year are included in s.* and thus would repeat or duplicate. By explicitly specifying the columns you need, you can avoid conflicts.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive