{"record":{"id":"bb78cfd963a6094b","repo":"microsoft/semantic-kernel","slug":"unsupported-scalar-field-type-field-type-str","errorCode":null,"errorMessage":"Unsupported scalar field type: {field_type_str}","messagePattern":"Unsupported scalar field type: (.+?)","errorType":"exception","errorClass":"VectorStoreOperationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/oracle.py","lineNumber":163,"sourceCode":"        \"clob\": \"CLOB\",\n        \"blob\": \"BLOB\",\n    }\n\n    list_pattern = re.compile(r\"list\\[(.*)\\]\")\n    if list_pattern.match(field_type_str):\n        return \"JSON\"\n\n    dict_pattern = re.compile(r\"dict\\[(.*?),\\s*(.*?)\\]\")\n    if dict_pattern.match(field_type_str):\n        return \"JSON\"\n\n    str_match = re.match(r\"str(?:\\((\\d+)\\))?$\", field_type_str)\n    if str_match:\n        size = str_match.group(1) or \"4000\"\n        return f\"VARCHAR2({size})\"\n\n    if field_type_str not in type_mapping:\n        raise VectorStoreOperationException(f\"Unsupported scalar field type: {field_type_str}\")\n\n    return type_mapping.get(field_type_str)\n\n\ndef _sk_vector_element_to_oracle(field_type_str: str) -> str | None:\n    \"\"\"Convert a Semantic Kernel vector element type string to an Oracle VECTOR element type string.\"\"\"\n    list_pattern = re.compile(r\"(?i)^list\\[(.*)\\]$\")\n    field_type = field_type_str.strip()\n\n    # Iteratively unwrap list[...] until no longer matches\n    while True:\n        match = list_pattern.match(field_type)\n        if not match:\n            break\n        field_type = match.group(1).strip()\n\n    # Return final mapped type if available\n    return VECTOR_TYPE_MAPPING.get(field_type)","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/oracle.py#L145-L181","documentation":"Thrown by _map_scalar_field_type_to_oracle when a key or data field's type string does not match any known Python-to-Oracle mapping (bool, byte, int, long, float, double, Decimal, UUID, date, datetime, timedelta, bytes, dict, clob, blob, or list[...]/dict[...]/str patterns). Used during DDL generation for non-vector fields.","triggerScenarios":"Defining a VectorStoreField with type_ set to an unsupported value (e.g. 'set', 'tuple', 'complex', a custom class name) for a key or data field, then triggering ensure_collection_exists / table creation.","commonSituations":"Custom field types without a mapping; typo in the type string; using a Python type the connector does not support; Decimal spelled as 'decimal'.","solutions":["Map the field to a supported scalar type: str, int, long, float, double, bool, datetime, date, bytes, UUID","For complex/structured data use dict or list[...] which map to Oracle JSON columns","For variable-length strings use str or str(N) which map to VARCHAR2","Check the field type_ spelling against the supported set in _map_scalar_field_type_to_oracle"],"exampleFix":"# before\ndefinition = VectorStoreCollectionDefinition(\n    key_field=VectorStoreField(name='id', type_='str'),\n    data_fields=[VectorStoreField(name='tags', type_='set[str]')],  # unsupported -> 1508\n)\n\n# after - use list[...] which maps to JSON\ndefinition = VectorStoreCollectionDefinition(\n    key_field=VectorStoreField(name='id', type_='str'),\n    data_fields=[VectorStoreField(name='tags', type_='list[str]')],  # maps to JSON\n)","handlingStrategy":"validation","validationCode":"SUPPORTED_SCALAR = {'bool','byte','int','long','float','double','Decimal','UUID','date','datetime','timedelta','bytes','dict','clob','blob'}\nimport re\n\ndef is_supported_scalar(t: str) -> bool:\n    if t in SUPPORTED_SCALAR:\n        return True\n    if re.match(r'list\\[.*\\]', t) or re.match(r'dict\\[(.*?),\\s*(.*?)\\]', t):\n        return True\n    if re.match(r'str(?:\\((\\d+)\\))?$', t):\n        return True\n    return False\n\nfor f in all_fields:\n    if f.field_type != 'vector' and not is_supported_scalar(f.type_ or ''):\n        raise ValueError(f'Unsupported scalar type {f.type_} on {f.name}')","typeGuard":null,"tryCatchPattern":"from semantic_kernel.exceptions import VectorStoreOperationException\n\ntry:\n    await collection.ensure_collection_exists()\nexcept VectorStoreOperationException as e:\n    if 'Unsupported scalar field type' in str(e):\n        # fix the offending field type_ in the definition\n        ...","preventionTips":["Map custom/structured data to dict or list[...] (JSON columns)","Spell types exactly as the connector expects (case-sensitive: 'Decimal', 'UUID')","Validate the data model definition before creating the collection"],"tags":["oracle","schema","vector-store","validation"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}