@cached_property
def schema(self):
    if (not self.selections):
        return self.table.schema()
    types = []
    names = []
    for projection in self.selections:
        if isinstance(projection, ir.DestructColumn):
            struct_type = projection.type()
            for name in struct_type.names:
                names.append(name)
                types.append(struct_type[name])
        elif isinstance(projection, ir.ValueExpr):
            names.append(projection.get_name())
            types.append(projection.type())
        elif isinstance(projection, ir.TableExpr):
            schema = projection.schema()
            names.extend(schema.names)
            types.extend(schema.types)
    return Schema(names, types)
@cached_property
def schema(self):
    if (not self.selections):
        return self.table.schema()
    types = []
    names = []
    for projection in self.selections:
        if isinstance(projection, ir.DestructColumn):
            struct_type = projection.type()
            for name in struct_type.names:
                names.append(name)
                types.append(struct_type[name])
        elif isinstance(projection, ir.ValueExpr):
            names.append(projection.get_name())
            types.append(projection.type())
        elif isinstance(projection, ir.TableExpr):
            schema = projection.schema()
            names.extend(schema.names)
            types.extend(schema.types)
    return Schema(names, types)