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
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive