<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: LPAD/RPAD Parsing Issues in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/LPAD-RPAD-Parsing-Issues/m-p/413501#M254094</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/133563"&gt;@garb&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for being part of our community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was reviewing the information and even though Calcite is the engine used for the SQL, looks like not all the queries are supported officially.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking in several places, I do not see LPAD used anywhere.&amp;nbsp;&lt;BR /&gt;But something that may work for what you need is CONCAT, which should give you the correct format properly and is broadly used in the community:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT
   MsgSeqNbr, PostTime, SSN, EmployeeID,
   LName, FName, MName,
   CAST(TRIM(LCN) AS BIGINT) AS LCN,
   RIGHT(CONCAT('00000', PIN), 5) AS PIN,
   EmployeeType, ValidityCode, AgencyOwner, AgencyLocated,
   BadgeCreatedBy, BadgeCreatedTime,
   BadgeModifiedBy, BadgeModifiedTime,
   Clearance, Error, Status
FROM FLOWFILE&lt;/LI-CODE&gt;&lt;P&gt;Based on the error &lt;FONT face="terminal,monaco"&gt;"No match found for function signature LPAD"&lt;/FONT&gt; it looks like the engine configured for NiFi does not support LPAD even when Calcite do support it.&amp;nbsp;&lt;BR /&gt;I was trying to find on the code the supported functions, but did not find LPAD.&amp;nbsp;&lt;BR /&gt;This looks to be the most accurate reference we have where we do see CONCAT:&amp;nbsp;&lt;A href="https://github.com/apache/nifi/blob/main/nifi-docs/src/main/asciidoc/record-path-guide.adoc" target="_blank"&gt;https://github.com/apache/nifi/blob/main/nifi-docs/src/main/asciidoc/record-path-guide.adoc&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Feb 2026 14:39:11 GMT</pubDate>
    <dc:creator>vafs</dc:creator>
    <dc:date>2026-02-04T14:39:11Z</dc:date>
    <item>
      <title>LPAD/RPAD Parsing Issues</title>
      <link>https://community.cloudera.com/t5/Support-Questions/LPAD-RPAD-Parsing-Issues/m-p/413076#M253837</link>
      <description>&lt;P&gt;&lt;STRONG&gt;NiFi Version: 2.5.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;When transporting information from one site to another, I need to prepend a 0 to someones PIN as that site has different requirements. I query the data using a QueryRecord processor, like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;SELECT
   MsgSeqNbr, PostTime, SSN, EmployeeID,
   LName, FName, MName,
   CAST(TRIM(LCN) AS BIGINT) AS LCN,
   LPAD(PIN, 5, '0'),
   EmployeeType, ValidityCode, AgencyOwner, AgencyLocated,
   BadgeCreatedBy, BadgeCreatedTime,
   BadgeModifiedBy, BadgeModifiedTime,
   Clearance, Error, Status
FROM FLOWFILE&lt;/LI-CODE&gt;&lt;P&gt;However I get the following error from Calcite:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;QUERY...
- Caused by:
org.apache.calcite.runtime.CalciteContentException: From line 5, column 5, column X: No match found for function signature LPAD(&amp;lt;CHARACTER&amp;gt;, &amp;lt;NUMERIC&amp;gt;, &amp;lt;CHARACTER&amp;gt;).&lt;/LI-CODE&gt;&lt;P&gt;I've tried a couple different methods to get this to pass, explicitly defining the type as VARCHAR(5) for both the string and the pattern, using a static value to see if it will pass but the same result occurs.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The incoming Avro data has the PIN like so:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;...
"PIN" : "111",
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So I know the data type it's receiving truly is a string. Following the ticket that was created for the original implementation it seems the dev's had the same intent for how to use the function:&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/CALCITE-5451" target="_blank" rel="noopener"&gt;https://issues.apache.org/jira/browse/CALCITE-5451&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Anyone else encounter a similar issue with Calcite?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2025 16:32:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/LPAD-RPAD-Parsing-Issues/m-p/413076#M253837</guid>
      <dc:creator>garb</dc:creator>
      <dc:date>2025-12-10T16:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPAD/RPAD Parsing Issues</title>
      <link>https://community.cloudera.com/t5/Support-Questions/LPAD-RPAD-Parsing-Issues/m-p/413501#M254094</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/133563"&gt;@garb&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for being part of our community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was reviewing the information and even though Calcite is the engine used for the SQL, looks like not all the queries are supported officially.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking in several places, I do not see LPAD used anywhere.&amp;nbsp;&lt;BR /&gt;But something that may work for what you need is CONCAT, which should give you the correct format properly and is broadly used in the community:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT
   MsgSeqNbr, PostTime, SSN, EmployeeID,
   LName, FName, MName,
   CAST(TRIM(LCN) AS BIGINT) AS LCN,
   RIGHT(CONCAT('00000', PIN), 5) AS PIN,
   EmployeeType, ValidityCode, AgencyOwner, AgencyLocated,
   BadgeCreatedBy, BadgeCreatedTime,
   BadgeModifiedBy, BadgeModifiedTime,
   Clearance, Error, Status
FROM FLOWFILE&lt;/LI-CODE&gt;&lt;P&gt;Based on the error &lt;FONT face="terminal,monaco"&gt;"No match found for function signature LPAD"&lt;/FONT&gt; it looks like the engine configured for NiFi does not support LPAD even when Calcite do support it.&amp;nbsp;&lt;BR /&gt;I was trying to find on the code the supported functions, but did not find LPAD.&amp;nbsp;&lt;BR /&gt;This looks to be the most accurate reference we have where we do see CONCAT:&amp;nbsp;&lt;A href="https://github.com/apache/nifi/blob/main/nifi-docs/src/main/asciidoc/record-path-guide.adoc" target="_blank"&gt;https://github.com/apache/nifi/blob/main/nifi-docs/src/main/asciidoc/record-path-guide.adoc&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 14:39:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/LPAD-RPAD-Parsing-Issues/m-p/413501#M254094</guid>
      <dc:creator>vafs</dc:creator>
      <dc:date>2026-02-04T14:39:11Z</dc:date>
    </item>
  </channel>
</rss>

