| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>AbstractTypeCoercion (Apache Calcite API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="AbstractTypeCoercion (Apache Calcite API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/AbstractTypeCoercion.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.calcite.sql.validate.implicit</a></div> |
| <h2 title="Class AbstractTypeCoercion" class="title">Class AbstractTypeCoercion</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="TypeCoercionImpl.html" title="class in org.apache.calcite.sql.validate.implicit">TypeCoercionImpl</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public abstract class <span class="typeNameLabel">AbstractTypeCoercion</span> |
| extends java.lang.Object |
| implements <a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></pre> |
| <div class="block">Base class for all the type coercion rules. If you want to have a custom type coercion rules, |
| inheriting this class is not necessary, but would have some convenient tool methods. |
| |
| <p>We make tool methods: <a href="#coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlCall, int, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNodeList,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlNodeList, int, org.apache.calcite.rel.type.RelDataType)</code></a>, |
| <a href="#needToCast(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)"><code>needToCast(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlNode, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#updateInferredType(org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)"><code>updateInferredType(org.apache.calcite.sql.SqlNode, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#updateInferredColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,int,org.apache.calcite.rel.type.RelDataType)"><code>updateInferredColumnType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlNode, int, org.apache.calcite.rel.type.RelDataType)</code></a> |
| all overridable by derived classes, you can define system specific type coercion logic. |
| |
| <p>Caution that these methods may modify the <a href="../../SqlNode.html" title="class in org.apache.calcite.sql"><code>SqlNode</code></a> tree, you should know what the |
| effect is when using these methods to customize your type coercion rules.</p> |
| |
| <p>This class also defines the default implementation of the type widening strategies, see |
| <a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit"><code>TypeCoercion</code></a> doc and methods: <a href="#getTightestCommonType(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"><code>getTightestCommonType(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#getWiderTypeFor(java.util.List,boolean)"><code>getWiderTypeFor(java.util.List<org.apache.calcite.rel.type.RelDataType>, boolean)</code></a>, |
| <a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"><code>getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType, boolean)</code></a>, <a href="#getWiderTypeForDecimal(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"><code>getWiderTypeForDecimal(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)</code></a>, |
| <a href="#commonTypeForBinaryComparison(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"><code>commonTypeForBinaryComparison(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)</code></a> for the detail strategies.</p></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#factory">factory</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#validator">validator</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.sql.validate.SqlValidator)">AbstractTypeCoercion</a></span>​(<a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a> validator)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>(package private) boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#canImplicitTypeCast(java.util.List,java.util.List)">canImplicitTypeCast</a></span>​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> types, |
| java.util.List<<a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type">SqlTypeFamily</a>> families)</code></th> |
| <td class="colLast"> |
| <div class="block">Check if the types and families can have implicit type coercion.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>private <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#castTo(org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)">castTo</a></span>​(<a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type)</code></th> |
| <td class="colLast"> |
| <div class="block">It should not be used directly, because some other work should be done |
| before cast operation, see <a href="#coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNodeList,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlNodeList, int, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlCall, int, org.apache.calcite.rel.type.RelDataType)</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNodeList,int,org.apache.calcite.rel.type.RelDataType)">coerceColumnType</a></span>​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNodeList.html" title="class in org.apache.calcite.sql">SqlNodeList</a> nodeList, |
| int index, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code></th> |
| <td class="colLast"> |
| <div class="block">Cast column at index <code>index</code> to target type.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,int,org.apache.calcite.rel.type.RelDataType)">coerceOperandType</a></span>​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| int index, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code></th> |
| <td class="colLast"> |
| <div class="block">Cast operand at index <code>index</code> to target type.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#commonTypeForBinaryComparison(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">commonTypeForBinaryComparison</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code></th> |
| <td class="colLast"> |
| <div class="block">Determines common type for a comparison operator when one operand is String type and the |
| other is not.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFactory()">getFactory</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTightestCommonType(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">getTightestCommonType</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code></th> |
| <td class="colLast"> |
| <div class="block">Case1: type widening with no precision loss.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValidator()">getValidator</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWiderTypeFor(java.util.List,boolean)">getWiderTypeFor</a></span>​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> typeList, |
| boolean stringPromotion)</code></th> |
| <td class="colLast"> |
| <div class="block">Similar to <a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"><code>getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType, boolean)</code></a>, but can handle |
| sequence types.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWiderTypeForDecimal(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">getWiderTypeForDecimal</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code></th> |
| <td class="colLast"> |
| <div class="block">Finds a wider type when one or both types are decimal type.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)">getWiderTypeForTwo</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2, |
| boolean stringPromotion)</code></th> |
| <td class="colLast"> |
| <div class="block">Case2: type widening.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#implicitCast(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeFamily)">implicitCast</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> in, |
| <a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type">SqlTypeFamily</a> expected)</code></th> |
| <td class="colLast"> |
| <div class="block">Type coercion based on the inferred type from passed in operand |
| and the <a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type"><code>SqlTypeFamily</code></a> defined in the checkers, |
| e.g.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#needToCast(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)">needToCast</a></span>​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code></th> |
| <td class="colLast"> |
| <div class="block">Decide if a SqlNode should be casted to target type, derived class |
| can override this strategy.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>private java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#partitionByCharacter(java.util.List)">partitionByCharacter</a></span>​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> types)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>private <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#promoteToVarChar(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">promoteToVarChar</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code></th> |
| <td class="colLast"> |
| <div class="block">Promote all the way to VARCHAR.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>(package private) <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#syncAttributes(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">syncAttributes</a></span>​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code></th> |
| <td class="colLast"> |
| <div class="block">Sync the data type additional attributes before casting, |
| i.e.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#updateInferredColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,int,org.apache.calcite.rel.type.RelDataType)">updateInferredColumnType</a></span>​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> query, |
| int columnIndex, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType1)</code></th> |
| <td class="colLast"> |
| <div class="block">Update inferred row type for a query, i.e.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#updateInferredType(org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)">updateInferredType</a></span>​(<a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type)</code></th> |
| <td class="colLast"> |
| <div class="block">Update inferred type for a SqlNode.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.calcite.sql.validate.implicit.TypeCoercion"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.calcite.sql.validate.implicit.<a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></h3> |
| <code><a href="TypeCoercion.html#binaryArithmeticCoercion(org.apache.calcite.sql.SqlCallBinding)">binaryArithmeticCoercion</a>, <a href="TypeCoercion.html#builtinFunctionCoercion(org.apache.calcite.sql.SqlCallBinding,java.util.List,java.util.List)">builtinFunctionCoercion</a>, <a href="TypeCoercion.html#caseWhenCoercion(org.apache.calcite.sql.SqlCallBinding)">caseWhenCoercion</a>, <a href="TypeCoercion.html#inOperationCoercion(org.apache.calcite.sql.SqlCallBinding)">inOperationCoercion</a>, <a href="TypeCoercion.html#rowTypeCoercion(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,int,org.apache.calcite.rel.type.RelDataType)">rowTypeCoercion</a>, <a href="TypeCoercion.html#userDefinedFunctionCoercion(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,org.apache.calcite.sql.SqlFunction)">userDefinedFunctionCoercion</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="validator"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>validator</h4> |
| <pre>protected <a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a> validator</pre> |
| </li> |
| </ul> |
| <a id="factory"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>factory</h4> |
| <pre>protected <a href="../../../rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a> factory</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>(org.apache.calcite.sql.validate.SqlValidator)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>AbstractTypeCoercion</h4> |
| <pre>AbstractTypeCoercion​(<a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a> validator)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="getFactory()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getFactory</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a> getFactory()</pre> |
| </li> |
| </ul> |
| <a id="getValidator()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getValidator</h4> |
| <pre class="methodSignature">public <a href="../SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a> getValidator()</pre> |
| </li> |
| </ul> |
| <a id="coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,int,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>coerceOperandType</h4> |
| <pre class="methodSignature">protected boolean coerceOperandType​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| int index, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</pre> |
| <div class="block">Cast operand at index <code>index</code> to target type. |
| we do this base on the fact that validate happens before type coercion.</div> |
| </li> |
| </ul> |
| <a id="coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNodeList,int,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>coerceColumnType</h4> |
| <pre class="methodSignature">protected boolean coerceColumnType​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNodeList.html" title="class in org.apache.calcite.sql">SqlNodeList</a> nodeList, |
| int index, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</pre> |
| <div class="block">Cast column at index <code>index</code> to target type.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>scope</code> - validator scope for the node list</dd> |
| <dd><code>nodeList</code> - column node list</dd> |
| <dd><code>index</code> - index of column</dd> |
| <dd><code>targetType</code> - target type to cast to</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if type coercion actually happens.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="syncAttributes(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>syncAttributes</h4> |
| <pre class="methodSignature"><a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> syncAttributes​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</pre> |
| <div class="block">Sync the data type additional attributes before casting, |
| i.e. nullability, charset, collation.</div> |
| </li> |
| </ul> |
| <a id="needToCast(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>needToCast</h4> |
| <pre class="methodSignature">protected boolean needToCast​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</pre> |
| <div class="block">Decide if a SqlNode should be casted to target type, derived class |
| can override this strategy.</div> |
| </li> |
| </ul> |
| <a id="castTo(org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>castTo</h4> |
| <pre class="methodSignature">private <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> castTo​(<a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type)</pre> |
| <div class="block">It should not be used directly, because some other work should be done |
| before cast operation, see <a href="#coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNodeList,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceColumnType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlNodeList, int, org.apache.calcite.rel.type.RelDataType)</code></a>, <a href="#coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlCall,int,org.apache.calcite.rel.type.RelDataType)"><code>coerceOperandType(org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.SqlCall, int, org.apache.calcite.rel.type.RelDataType)</code></a>. |
| |
| <p>Ignore constant reduction which should happen in RexSimplify.</div> |
| </li> |
| </ul> |
| <a id="updateInferredType(org.apache.calcite.sql.SqlNode,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>updateInferredType</h4> |
| <pre class="methodSignature">protected void updateInferredType​(<a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type)</pre> |
| <div class="block">Update inferred type for a SqlNode.</div> |
| </li> |
| </ul> |
| <a id="updateInferredColumnType(org.apache.calcite.sql.validate.SqlValidatorScope,org.apache.calcite.sql.SqlNode,int,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>updateInferredColumnType</h4> |
| <pre class="methodSignature">protected void updateInferredColumnType​(<a href="../SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> query, |
| int columnIndex, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType1)</pre> |
| <div class="block">Update inferred row type for a query, i.e. SqlCall that returns struct type |
| or SqlSelect.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>scope</code> - validator scope</dd> |
| <dd><code>query</code> - node to inferred type</dd> |
| <dd><code>columnIndex</code> - column index to update</dd> |
| <dd><code>targetType1</code> - desired column type</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getTightestCommonType(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getTightestCommonType</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getTightestCommonType​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</pre> |
| <div class="block">Case1: type widening with no precision loss. |
| Find the tightest common type of two types that might be used in binary expression.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="TypeCoercion.html#getTightestCommonType(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">getTightestCommonType</a></code> in interface <code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>tightest common type i.e. INTEGER + DECIMAL(10, 2) will return DECIMAL(10, 2)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="promoteToVarChar(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>promoteToVarChar</h4> |
| <pre class="methodSignature">private <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> promoteToVarChar​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</pre> |
| <div class="block">Promote all the way to VARCHAR.</div> |
| </li> |
| </ul> |
| <a id="commonTypeForBinaryComparison(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>commonTypeForBinaryComparison</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> commonTypeForBinaryComparison​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</pre> |
| <div class="block">Determines common type for a comparison operator when one operand is String type and the |
| other is not. For date + timestamp operands, use timestamp as common type, |
| i.e. Timestamp(2017-01-01 00:00 ...) > Date(2018) evaluates to be false.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="TypeCoercion.html#commonTypeForBinaryComparison(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">commonTypeForBinaryComparison</a></code> in interface <code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getWiderTypeForTwo</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeForTwo​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2, |
| boolean stringPromotion)</pre> |
| <div class="block">Case2: type widening. The main difference with <a href="#getTightestCommonType(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"><code>getTightestCommonType(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType)</code></a> |
| is that we allow some precision loss when widening decimal to fractional, |
| or promote fractional to string type.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="TypeCoercion.html#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)">getWiderTypeForTwo</a></code> in interface <code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getWiderTypeForDecimal(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getWiderTypeForDecimal</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeForDecimal​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</pre> |
| <div class="block">Finds a wider type when one or both types are decimal type. |
| If the wider decimal type's precision/scale exceeds system limitation, |
| this rule will truncate the decimal type to the max precision/scale. |
| For decimal and fractional types, returns a decimal type |
| which has the higher precision of the two. |
| |
| <p>The default implementation depends on the max precision/scale of the type system, |
| you can override it based on the specific system requirement in |
| <a href="../../../rel/type/RelDataTypeSystem.html" title="interface in org.apache.calcite.rel.type"><code>RelDataTypeSystem</code></a>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="TypeCoercion.html#getWiderTypeForDecimal(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">getWiderTypeForDecimal</a></code> in interface <code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getWiderTypeFor(java.util.List,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getWiderTypeFor</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeFor​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> typeList, |
| boolean stringPromotion)</pre> |
| <div class="block">Similar to <a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"><code>getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType, boolean)</code></a>, but can handle |
| sequence types. <a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"><code>getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType, boolean)</code></a> doesn't satisfy the associative law, |
| i.e. (a op b) op c may not equal to a op (b op c). This is only a problem for STRING type or |
| nested STRING type in collection type like ARRAY. Excluding these types, |
| <a href="#getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType,boolean)"><code>getWiderTypeForTwo(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType, boolean)</code></a> satisfies the associative law. For instance, |
| (DATE, INTEGER, VARCHAR) should have VARCHAR as the wider common type.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="TypeCoercion.html#getWiderTypeFor(java.util.List,boolean)">getWiderTypeFor</a></code> in interface <code><a href="TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="partitionByCharacter(java.util.List)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>partitionByCharacter</h4> |
| <pre class="methodSignature">private java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> partitionByCharacter​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> types)</pre> |
| </li> |
| </ul> |
| <a id="canImplicitTypeCast(java.util.List,java.util.List)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>canImplicitTypeCast</h4> |
| <pre class="methodSignature">boolean canImplicitTypeCast​(java.util.List<<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> types, |
| java.util.List<<a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type">SqlTypeFamily</a>> families)</pre> |
| <div class="block">Check if the types and families can have implicit type coercion. |
| We will check the type one by one, that means the 1th type and 1th family, |
| 2th type and 2th family, and the like.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>types</code> - data type need to check.</dd> |
| <dd><code>families</code> - desired type families list.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if we can do type coercion.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="implicitCast(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.sql.type.SqlTypeFamily)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>implicitCast</h4> |
| <pre class="methodSignature">public <a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> implicitCast​(<a href="../../../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> in, |
| <a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type">SqlTypeFamily</a> expected)</pre> |
| <div class="block">Type coercion based on the inferred type from passed in operand |
| and the <a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type"><code>SqlTypeFamily</code></a> defined in the checkers, |
| e.g. the <a href="../../type/FamilyOperandTypeChecker.html" title="class in org.apache.calcite.sql.type"><code>FamilyOperandTypeChecker</code></a>. |
| |
| <p>Caution that we do not cast from NUMERIC to NUMERIC. |
| See <a href="https://docs.google.com/spreadsheets/d/1GhleX5h5W8-kJKh7NMJ4vtoE78pwfaZRJl88ULX_MgU/edit?usp=sharing">CalciteImplicitCasts</a> |
| for the details.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>in</code> - inferred operand type.</dd> |
| <dd><code>expected</code> - expected <a href="../../type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type"><code>SqlTypeFamily</code></a> of registered SqlFunction.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>common type of implicit cast, null if we do not find any.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/AbstractTypeCoercion.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2012–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |