| 137 | } |
| 138 | |
| 139 | SerializationPtr DataTypeObject::doGetSerialization(const SerializationInfoSettings & settings) const |
| 140 | { |
| 141 | std::unordered_map<String, SerializationPtr> typed_paths_serializations; |
| 142 | typed_paths_serializations.reserve(typed_paths.size()); |
| 143 | for (const auto & [path, type] : typed_paths) |
| 144 | typed_paths_serializations[path] = settings.propagate_types_serialization_versions_to_nested_types ? type->getSerialization(settings) : type->getDefaultSerialization(); |
| 145 | |
| 146 | SerializationPtr dynamic_serialization = settings.propagate_types_serialization_versions_to_nested_types |
| 147 | ? getDynamicType()->getSerialization(settings) |
| 148 | : getDynamicType()->getDefaultSerialization(); |
| 149 | |
| 150 | switch (schema_format) |
| 151 | { |
| 152 | case SchemaFormat::JSON: |
| 153 | #if USE_SIMDJSON |
| 154 | auto context = CurrentThread::tryGetQueryContext(); |
| 155 | if (!context) |
| 156 | context = Context::getGlobalContextInstance(); |
| 157 | if (context->getSettingsRef()[Setting::allow_simdjson]) |
| 158 | return SerializationJSON<SimdJSONParser>::create( |
| 159 | typed_paths, |
| 160 | typed_paths_serializations, |
| 161 | paths_to_skip, |
| 162 | path_regexps_to_skip, |
| 163 | getDynamicType(), |
| 164 | dynamic_serialization, |
| 165 | buildJSONExtractTree<SimdJSONParser>(getPtr(), "JSON serialization")); |
| 166 | #endif |
| 167 | |
| 168 | #if USE_RAPIDJSON |
| 169 | return SerializationJSON<RapidJSONParser>::create( |
| 170 | typed_paths, |
| 171 | typed_paths_serializations, |
| 172 | paths_to_skip, |
| 173 | path_regexps_to_skip, |
| 174 | getDynamicType(), |
| 175 | dynamic_serialization, |
| 176 | buildJSONExtractTree<RapidJSONParser>(getPtr(), "JSON serialization")); |
| 177 | #else |
| 178 | return SerializationJSON<DummyJSONParser>::create( |
| 179 | typed_paths, |
| 180 | typed_paths_serializations, |
| 181 | paths_to_skip, |
| 182 | path_regexps_to_skip, |
| 183 | getDynamicType(), |
| 184 | dynamic_serialization, |
| 185 | buildJSONExtractTree<DummyJSONParser>(getPtr(), "JSON serialization")); |
| 186 | #endif |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | String DataTypeObject::getSchemaFormatString() const |
| 191 | { |
nothing calls this directly
no test coverage detected