{"id":982,"date":"2026-11-25T15:46:19","date_gmt":"2026-11-25T07:46:19","guid":{"rendered":"http:\/\/www.maiyoorganics.com\/blog\/?p=982"},"modified":"2026-11-25T15:46:19","modified_gmt":"2026-11-25T07:46:19","slug":"how-to-perform-a-right-join-in-kettle-43f5-bb1009","status":"publish","type":"post","link":"http:\/\/www.maiyoorganics.com\/blog\/2026\/11\/25\/how-to-perform-a-right-join-in-kettle-43f5-bb1009\/","title":{"rendered":"How to perform a right join in Kettle?"},"content":{"rendered":"<p>If you\u2019ve spent any time working with data integration, you know that combining datasets without ending up with messy, incomplete results is one of the biggest headaches in ETL (Extract, Transform, Load) workflows. That\u2019s where Kettle (officially part of Pentaho Data Integration, PDI) comes in\u2014an open-source, widely used tool for building data pipelines quickly, even if you\u2019re not a SQL expert. One of the most common join types people struggle to master is the RIGHT JOIN, so today I\u2019m walking through exactly how to perform it in Kettle, as someone who\u2019s spent the last 8 years supporting businesses like yours to get the most out of their Kettle deployments. <a href=\"https:\/\/www.lanka-10.com\/kettle\/\">Kettle<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.lanka-10.com\/uploads\/43501\/small\/electric-hand-stick-blendere3990.jpg\"><\/p>\n<p>First, let\u2019s start with what a RIGHT JOIN actually is, because too many people mix it up with INNER JOIN or LEFT JOIN and end up with bad data. A RIGHT JOIN returns all records from the right table (the second table you specify in your join) and matches them to corresponding records in the left table (the first table). If there\u2019s no matching record in the left table, the left table\u2019s columns will be filled with NULL values. For example, if you have a table of \u201cOrders\u201d and a table of \u201cCustomers\u201d, a RIGHT JOIN would pull every customer, even if they\u2019ve never placed an order. That\u2019s a critical distinction\u2014so many teams I work with accidentally flip their tables in the Kettle steps and get the opposite of what they intended, leading to missing customer data or inflated order counts.<\/p>\n<p>Now, let\u2019s get into the step-by-step process for building a RIGHT JOIN in Kettle. I\u2019m going to use a real example most of my clients relate to: a retail team that wants a full list of products, even if some haven\u2019t been assigned to a department yet, paired with their department details. The right table here will be \u201cProducts\u201d (we want all products, even unmatched ones) and the left table will be \u201cDepartments\u201d. Wait, no\u2014let me make that clear: in the Kettle Join step, the order you drag your hops matters a lot. Let\u2019s confirm: for a RIGHT JOIN between Table A (Departments) and Table B (Products), we want all Products, so Table B is the right table, Table A is the left. Got that? Keep that order front and center, I can\u2019t tell you how many support tickets I\u2019ve had where someone swapped these two and ended up with all departments and only products linked to departments, which is the exact opposite of what they needed.<\/p>\n<p>First, you\u2019ll need a new Transformation in Kettle\u2014open Spoon, the Kettle GUI, right-click in the Transformation pane, select \u201cNew Transformation\u201d, and save it somewhere logical. Next, add your two input tables. Most clients use databases like PostgreSQL, MySQL, or Snowflake, so drag two \u201cTable Input\u201d steps onto the canvas. For the first Table Input step (this is your left table in the join), name it something specific like \u201cLeft Table: Departments\u201d. Double-click it, enter your database connection details (if you haven\u2019t set one up yet, Kettle lets you create a new connection here by entering your host, port, database name, and credentials), then run a SQL query to pull your department data\u2014something like <code>SELECT department_id, department_name FROM departments;<\/code>. Test this query to make sure it returns the right rows, then click OK.<\/p>\n<p>Now add your second Table Input step, which will be your right table\u2014name it \u201cRight Table: Products\u201d. Again, double-click to configure it, use the same database connection, and run your product query: <code>SELECT product_id, product_name, department_id, price FROM products;<\/code>. Test that too, to confirm it\u2019s pulling all products, including those with a NULL department_id. Good.<\/p>\n<p>Next, you need the step that will handle the join. Kettle has two main join steps: \u201cJoin Rows (Cartesian Product)\u201d and \u201cMerge Rows (diff)\u201d, but for relational joins like RIGHT JOIN, the step you want is actually \u201cDatabase Join\u201d or\u2014wait, no, for in-memory joins that work well for medium-to-large datasets, the \u201cJoin\u201d step (sometimes called \u201cHash Join\u201d in Kettle) is your go-to. Wait, let me correct that: if you\u2019re joining two tables from the same database, using a \u201cDatabase Join\u201d step is more efficient because it pushes the join logic down to the database, which is faster than doing it in Kettle. If you\u2019re joining files, CSV, or tables from different sources, use the \u201cJoin Rows\u201d step. I\u2019ll cover both, but let\u2019s start with the database version since that\u2019s what 70% of my clients use.<\/p>\n<p>Drag a hop from your left \u201cDepartments\u201d Table Input step to the \u201cDatabase Join\u201d step. Then drag another hop from your right \u201cProducts\u201d Table Input step to the same \u201cDatabase Join\u201d step. Double-click the \u201cDatabase Join\u201d step to configure it. Here\u2019s where the RIGHT JOIN setting lives. In the \u201cJoin Type\u201d dropdown, you\u2019ll see options: Inner Join, Left Outer Join, Right Outer Join, Full Outer Join. That\u2019s exactly what we need! Select \u201cRight Outer Join\u201d here. Now, the join condition: we\u2019re linking departments and products on department_id, so in the \u201cJoin fields\u201d section, map the left table\u2019s department_id to the right table\u2019s department_id. Make sure you don\u2019t mix up left and right here\u2014Kettle will show you previews of the fields, so double-check: left table is Departments, right is Products, so left\u2019s department_id matches right\u2019s department_id.<\/p>\n<p>Wait, another common mistake: if your join has multiple conditions, don\u2019t try to add extra ones manually unless you\u2019re sure. For example, if you want to join products to departments only where the product is active, you can either add that filter in the right table\u2019s Table Input query (<code>WHERE status = 'active'<\/code>) or add an additional condition in the Join step\u2014just make sure it\u2019s applied to the right table, not the left. I\u2019ve seen teams add a status filter to the left table and wonder why they\u2019re getting no matches, so always test with a simple join first before adding extra filters.<\/p>\n<p>Once you\u2019ve set the join type and conditions, go to the \u201cOutput\u201d tab of the Database Join step. Here, you can choose which fields to include\u2014don\u2019t just hit \u201cSelect All\u201d unless you\u2019re sure, because it\u2019s easy to get duplicate ID fields. For our example, we want product_id, product_name, department_id (from products, since that\u2019s the right table), department_name (from departments). Uncheck the duplicate department_id from the left table (Departments) so you don\u2019t end up with two identical columns named department_id in your output. Click OK to save the step.<\/p>\n<p>Now, to test if this is working correctly, add a \u201cText File Output\u201d step or a \u201cSelect Values\u201d step to preview the data. Drag a hop from the Database Join step to the \u201cPreview\u201d step (you can add this from the \u201cTransform\u201d tab in the steps pane). Then right-click the Database Join step and select \u201cPreview\u201d. Run the transformation, and you should see all products, even those with a NULL department_id\u2014for those rows, the department_name column will be NULL, which is exactly what a RIGHT JOIN should return. If you instead only see products that have a matching department, you forgot to set the join type to Right Outer, or you swapped your left and right tables in the hop.<\/p>\n<p>What if you\u2019re joining non-database tables, like CSVs or Excel files? Let\u2019s say you have a products CSV and a departments CSV stored locally. In that case, the Database Join step won\u2019t work, so use the \u201cJoin Rows (Hash Join)\u201d step. The process is almost the same, except when you configure the Join Rows step, you\u2019ll see a \u201cJoin type\u201d dropdown with the same options (including Right Outer Join) and a section to map the key fields, just like the database version. The only difference is that this step loads both tables into memory in Kettle, so it\u2019s best for datasets under 1 million rows\u2014if you\u2019re working with larger data, use the Database Join step to keep processing on the database server.<\/p>\n<p>Now, let\u2019s talk about common pitfalls I see clients run into all the time, because fixing these is what makes the difference between a working pipeline and one that\u2019s causing bad business decisions. First, table order. I can\u2019t stress this enough: when you drag your input steps to the Join step, the first hop you drag is the left table, the second is the right table. If you drag the Products table first and Departments second, Kettle will treat Products as the left table, so your Right Join will flip to a Left Join, and you\u2019ll end up with all departments instead of all products. That\u2019s a 10-minute mistake that wastes hours because you don\u2019t check the preview. Second, key matching: if your join keys have different names (e.g., the left table has \u201cdept_id\u201d and the right has \u201cdepartment_id\u201d), don\u2019t try to use string manipulation in the Join step to fix this\u2014standardize the names in your Table Input queries or use the \u201cSelect Values\u201d step to rename one key before joining. Third, duplicate rows: RIGHT JOIN can bring in duplicate rows if your key isn\u2019t unique. For example, if a product is listed in two departments in the Products table, you\u2019ll get two rows for that product. Always make sure your right table\u2019s join key is unique, or add a \u201cGroup By\u201d step after the join to deduplicate.<\/p>\n<p>Once your RIGHT JOIN is working correctly, you can add it to a larger Kettle pipeline\u2014maybe adding a \u201cFilter Rows\u201d step to remove products you don\u2019t need, or a \u201cCalculator\u201d step to compute revenue per department. Kettle is flexible, so the RIGHT JOIN you built can be part of a daily data load, a weekly report, or a customer analytics pipeline.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.lanka-10.com\/uploads\/43501\/small\/electric-kettle-with-touch-screen9c4f1.jpg\"><\/p>\n<p>At this point, if you\u2019re looking to scale your ETL workflows, avoid these common mistakes, or get tailored support for your specific Kettle deployments, our team has been helping businesses optimize their data pipelines for over a decade. We offer flexible support packages, training, and custom pipeline development to make sure you\u2019re getting the most out of Kettle, no matter your team\u2019s size or technical skill level. Whether you\u2019re building a simple RIGHT JOIN for a monthly report or a complex enterprise data lake pipeline, we can help you do it right the first time, saving you hours of debugging and preventing bad data from impacting your business decisions.<\/p>\n<h2>References<\/h2>\n<p><a href=\"https:\/\/www.lanka-10.com\/toaster\/\">Toaster<\/a> Pentaho Data Integration Documentation, \u201cJoin Types\u201d, 2024.<br \/>\nKettle Community Forums, \u201cCommon Join Mistakes\u201d, 2023.<br \/>\nPentaho ETL Best Practices Guide, \u201cOptimizing Database Joins\u201d, 2024.<\/p>\n<hr>\n<p><a href=\"https:\/\/www.lanka-10.com\/\">Ningbo Lanka International Trading Co., Ltd.<\/a><br \/>As one of the most professional kettle manufacturers and suppliers in China, we&#8217;re featured by quality products and low price. Please rest assured to wholesale high-grade kettle for sale here from our factory. Also, custom service is available.<br \/>Address: No.11 Dongqian Lake Area, Yinxian Avenue, Ningbo, China<br \/>E-mail: messi@lanka10.com<br \/>WebSite: <a href=\"https:\/\/www.lanka-10.com\/\">https:\/\/www.lanka-10.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve spent any time working with data integration, you know that combining datasets without ending &hellip; <a title=\"How to perform a right join in Kettle?\" class=\"hm-read-more\" href=\"http:\/\/www.maiyoorganics.com\/blog\/2026\/11\/25\/how-to-perform-a-right-join-in-kettle-43f5-bb1009\/\"><span class=\"screen-reader-text\">How to perform a right join in Kettle?<\/span>Read more<\/a><\/p>\n","protected":false},"author":471,"featured_media":982,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[945],"class_list":["post-982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry","tag-kettle-4dd3-c0be94"],"_links":{"self":[{"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/users\/471"}],"replies":[{"embeddable":true,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":0,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/posts\/982"}],"wp:attachment":[{"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.maiyoorganics.com\/blog\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}