| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>AbstractTypeCoercion (Apache Calcite calcite API)</title> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="AbstractTypeCoercion (Apache Calcite calcite API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":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"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</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 class="aboutLanguage"><b>Apache Calcite</b></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html" target="_top">Frames</a></li> |
| <li><a href="AbstractTypeCoercion.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></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> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </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>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.calcite.sql.validate.implicit</div> |
| <h2 title="Class AbstractTypeCoercion" class="title">Class AbstractTypeCoercion</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></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><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.html" title="class in org.apache.calcite.sql.validate.implicit">TypeCoercionImpl</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public abstract class <span class="typeNameLabel">AbstractTypeCoercion</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> |
| implements <a href="../../../../../../org/apache/calcite/sql/validate/implicit/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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/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>This class also defines the default implementation of the type widening strategies, see |
| <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit"><code>TypeCoercion</code></a> doc and methods: <a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#getWiderTypeFor-java.util.List-boolean-"><code>getWiderTypeFor(java.util.List<org.apache.calcite.rel.type.RelDataType>, boolean)</code></a>, |
| <a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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.</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../../org/apache/calcite/rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#factory">factory</a></span></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../../org/apache/calcite/sql/validate/SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#validator">validator</a></span></code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <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="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#coerceColumnType-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlNodeList-int-org.apache.calcite.rel.type.RelDataType-">coerceColumnType</a></span>(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNodeList.html" title="class in org.apache.calcite.sql">SqlNodeList</a> nodeList, |
| int index, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code> |
| <div class="block">Cast column at index <code>index</code> to target type.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#coerceOperandsType-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlCall-org.apache.calcite.rel.type.RelDataType-">coerceOperandsType</a></span>(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> commonType)</code> |
| <div class="block">Coerce all the operands to <code>commonType</code>.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#coerceOperandType-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlCall-int-org.apache.calcite.rel.type.RelDataType-">coerceOperandType</a></span>(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| int index, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> targetType)</code> |
| <div class="block">Cast operand at index <code>index</code> to target type.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#commonTypeForBinaryComparison-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">commonTypeForBinaryComparison</a></span>(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code> |
| <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="i4" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#getTightestCommonType-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">getTightestCommonType</a></span>(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code> |
| <div class="block">Case1: type widening with no precision loss.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#getWiderTypeFor-java.util.List-boolean-">getWiderTypeFor</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>> typeList, |
| boolean stringPromotion)</code> |
| <div class="block">Similar to <a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="i6" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#getWiderTypeForDecimal-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">getWiderTypeForDecimal</a></span>(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2)</code> |
| <div class="block">Finds a wider type when one or both types are decimal type.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#getWiderTypeForTwo-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-boolean-">getWiderTypeForTwo</a></span>(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type2, |
| boolean stringPromotion)</code> |
| <div class="block">Case2: type widening.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#implicitCast-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.sql.type.SqlTypeFamily-">implicitCast</a></span>(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> in, |
| <a href="../../../../../../org/apache/calcite/sql/type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type">SqlTypeFamily</a> expected)</code> |
| <div class="block">Type coercion based on the inferred type from passed in operand |
| and the <a href="../../../../../../org/apache/calcite/sql/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="i9" class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#needToCast-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlNode-org.apache.calcite.rel.type.RelDataType-">needToCast</a></span>(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> toType)</code> |
| <div class="block">Decide if a SqlNode should be casted to target type, derived class |
| can override this strategy.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#updateInferredColumnType-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlNode-int-org.apache.calcite.rel.type.RelDataType-">updateInferredColumnType</a></span>(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> query, |
| int columnIndex, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> desiredType)</code> |
| <div class="block">Update inferred row type for a query, i.e.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#updateInferredType-org.apache.calcite.sql.SqlNode-org.apache.calcite.rel.type.RelDataType-">updateInferredType</a></span>(<a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type)</code> |
| <div class="block">Update inferred type for a SqlNode.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></h3> |
| <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#binaryArithmeticCoercion-org.apache.calcite.sql.SqlCallBinding-">binaryArithmeticCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#binaryComparisonCoercion-org.apache.calcite.sql.SqlCallBinding-">binaryComparisonCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#builtinFunctionCoercion-org.apache.calcite.sql.SqlCallBinding-java.util.List-java.util.List-">builtinFunctionCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#caseWhenCoercion-org.apache.calcite.sql.SqlCallBinding-">caseWhenCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#inOperationCoercion-org.apache.calcite.sql.SqlCallBinding-">inOperationCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#querySourceCoercion-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.sql.SqlNode-">querySourceCoercion</a>, <a href="../../../../../../org/apache/calcite/sql/validate/implicit/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="../../../../../../org/apache/calcite/sql/validate/implicit/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> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="validator"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>validator</h4> |
| <pre>protected <a href="../../../../../../org/apache/calcite/sql/validate/SqlValidator.html" title="interface in org.apache.calcite.sql.validate">SqlValidator</a> validator</pre> |
| </li> |
| </ul> |
| <a name="factory"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>factory</h4> |
| <pre>protected <a href="../../../../../../org/apache/calcite/rel/type/RelDataTypeFactory.html" title="interface in org.apache.calcite.rel.type">RelDataTypeFactory</a> factory</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="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>protected boolean coerceOperandType(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| int index, |
| <a href="../../../../../../org/apache/calcite/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 name="coerceOperandsType-org.apache.calcite.sql.validate.SqlValidatorScope-org.apache.calcite.sql.SqlCall-org.apache.calcite.rel.type.RelDataType-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>coerceOperandsType</h4> |
| <pre>protected boolean coerceOperandsType(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlCall.html" title="class in org.apache.calcite.sql">SqlCall</a> call, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> commonType)</pre> |
| <div class="block">Coerce all the operands to <code>commonType</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>scope</code> - Validator scope</dd> |
| <dd><code>call</code> - the call</dd> |
| <dd><code>commonType</code> - common type to coerce to</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="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>protected boolean coerceColumnType(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNodeList.html" title="class in org.apache.calcite.sql">SqlNodeList</a> nodeList, |
| int index, |
| <a href="../../../../../../org/apache/calcite/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> |
| </dl> |
| </li> |
| </ul> |
| <a name="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>protected boolean needToCast(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> toType)</pre> |
| <div class="block">Decide if a SqlNode should be casted to target type, derived class |
| can override this strategy.</div> |
| </li> |
| </ul> |
| <a name="updateInferredType-org.apache.calcite.sql.SqlNode-org.apache.calcite.rel.type.RelDataType-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>updateInferredType</h4> |
| <pre>protected void updateInferredType(<a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> node, |
| <a href="../../../../../../org/apache/calcite/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 name="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>protected void updateInferredColumnType(<a href="../../../../../../org/apache/calcite/sql/validate/SqlValidatorScope.html" title="interface in org.apache.calcite.sql.validate">SqlValidatorScope</a> scope, |
| <a href="../../../../../../org/apache/calcite/sql/SqlNode.html" title="class in org.apache.calcite.sql">SqlNode</a> query, |
| int columnIndex, |
| <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> desiredType)</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>desiredType</code> - Desired column type</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getTightestCommonType-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getTightestCommonType</h4> |
| <pre>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getTightestCommonType(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#getTightestCommonType-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">getTightestCommonType</a></code> in interface <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/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) returns DECIMAL(10, 2)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="commonTypeForBinaryComparison-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>commonTypeForBinaryComparison</h4> |
| <pre>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> commonTypeForBinaryComparison(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#commonTypeForBinaryComparison-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">commonTypeForBinaryComparison</a></code> in interface <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="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>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeForTwo(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#getWiderTypeForTwo-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-boolean-">getWiderTypeForTwo</a></code> in interface <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getWiderTypeForDecimal-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getWiderTypeForDecimal</h4> |
| <pre>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeForDecimal(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> type1, |
| <a href="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#getWiderTypeForDecimal-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.rel.type.RelDataType-">getWiderTypeForDecimal</a></code> in interface <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getWiderTypeFor-java.util.List-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getWiderTypeFor</h4> |
| <pre>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> getWiderTypeFor(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../org/apache/calcite/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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html#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="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html#getWiderTypeFor-java.util.List-boolean-">getWiderTypeFor</a></code> in interface <code><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit">TypeCoercion</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="implicitCast-org.apache.calcite.rel.type.RelDataType-org.apache.calcite.sql.type.SqlTypeFamily-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>implicitCast</h4> |
| <pre>public <a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> implicitCast(<a href="../../../../../../org/apache/calcite/rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> in, |
| <a href="../../../../../../org/apache/calcite/sql/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="../../../../../../org/apache/calcite/sql/type/SqlTypeFamily.html" title="enum in org.apache.calcite.sql.type"><code>SqlTypeFamily</code></a> defined in the checkers, |
| e.g. the <a href="../../../../../../org/apache/calcite/sql/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="../../../../../../org/apache/calcite/sql/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> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</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 class="aboutLanguage"><b>Apache Calcite</b></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../../../org/apache/calcite/sql/validate/implicit/TypeCoercion.html" title="interface in org.apache.calcite.sql.validate.implicit"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.html" target="_top">Frames</a></li> |
| <li><a href="AbstractTypeCoercion.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses-noframe.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> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </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>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p> |
| </body> |
| </html> |