568 bool skipNested =
false;
569 JsonbIteratorToken
r;
572 if (!JB_ROOT_IS_OBJECT(jb))
575 it = JsonbIteratorInit(&jb->root);
577 while ((
r = JsonbIteratorNext(&it, &v, skipNested)) != WJB_DONE)
581 if (
r == WJB_KEY && v.type != jbvNull)
590 key = palloc(v.val.string.len + 1);
591 memcpy(key, v.val.string.val, v.val.string.len);
592 key[v.val.string.len] =
'\0';
594 tags = repalloc(tags, newSize * 2 *
sizeof(*tags));
598 r = JsonbIteratorNext(&it, &v, skipNested);
600 if (v.type == jbvString)
603 value = palloc(v.val.string.len + 1);
604 memcpy(
value, v.val.string.val, v.val.string.len);
605 value[v.val.string.len] =
'\0';
609 else if (v.type == jbvBool)
612 bool_values_hash, bool_value,
sizeof(protobuf_c_boolean));
615 else if (v.type == jbvNumeric)
620 str = DatumGetCString(DirectFunctionCall1(numeric_out,
621 PointerGetDatum(v.val.numeric)));
622 d = strtod(
str, NULL);
623 l = strtol(
str, NULL, 10);
625 if (fabs(d - (
double)l) > FLT_EPSILON)
628 double_value,
sizeof(
double));
static uint32_t get_key_index_with_size(mvt_agg_context *ctx, const char *name, size_t size)
#define MVT_PARSE_INT_VALUE(value)
static uint32_t add_key(mvt_agg_context *ctx, char *name)
static void add_value_as_string(mvt_agg_context *ctx, char *value, uint32_t *tags, uint32_t k)
#define MVT_PARSE_VALUE(value, kvtype, hash, valuefield, size)