private SqlModality deduceModality ( SqlNode query ) { if ( query instanceof SqlSelect ) { SqlSelect select = ( SqlSelect ) query ; return select . getModifierNode ( SqlSelectKeyword . STREAM ) != null ? SqlModality . STREAM : SqlModality . RELATION ; } else if ( query . getKind ( ) == SqlKind . VALUES ) { return SqlModality . RELATION ; } else { assert query . isA ( SqlKind . SET_QUERY ) ; final SqlCall call = ( SqlCall ) query ; return deduceModality ( call . getOperandList ( ) . get ( 0 ) ) ; } }
Return the intended modality of a SELECT or set - op .