phalcon/cphalcon · error · UnknownColumnType

Unknown column type

Error message

Unknown column type {type}

What it means

Generic guard at the end of Query::getSelectColumn: the column's 'type' from the IR (e.g. scalar/qualified/object/functionCall) matches none of the handled cases, so the column kind is unrecognized. The input at fault is the select column entry in the parsed AST/IR.

Solutions

  1. Simplify the SELECT expression the parser cannot classify (custom/complex expressions).
  2. Verify the PHQL was produced for the same Phalcon version doing the execution.
  3. Catch the exception and log the PHQL and column type value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:3548 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/c41c7d8a28b139f8. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Mvc/Model/Query.zep:3548

             * Create balias and sqlAlias
             */
            if fetch balias, sqlExprColumn["balias"] {
                let sqlColumn["balias"] = balias,
                    sqlColumn["sqlAlias"] = balias;
            }

            if eager !== null {
                let sqlColumn["eager"] = eager,
                    sqlColumn["eagerType"] = column["eagerType"];
            }

            let sqlColumn["column"] = sqlExprColumn,
                sqlColumns[] = sqlColumn;

            return sqlColumns;
        }

        throw new UnknownColumnType(columnType);
    }

    /**
     * Resolves joins involving has-one/belongs-to/has-many relations
     *
     * @param string joinSource
     */
    final protected function getSingleJoin( string joinType, joinSource, string modelAlias, string joinAlias, <RelationInterface> relation) -> array
    {
        var fields, referencedFields, sqlJoinConditions = null,
            sqlJoinPartialConditions, position, field, referencedField;

        /**
         * Local fields in the 'from' relation
         */
        let fields = relation->getFields();

        /**

View on GitHub (pinned to b7419de9cd)