Package com.facebook.presto.operator.scalar.JsonExtract

Examples of com.facebook.presto.operator.scalar.JsonExtract.JsonSizeExtractor


                        methodHandle = constantJsonExtract;
                        jsonExtractor = generateExtractor(pattern, new JsonValueJsonExtractor());
                        break;
                    case JSON_SIZE_FUNCTION_NAME:
                        methodHandle = constantJsonSize;
                        jsonExtractor = generateExtractor(pattern, new JsonSizeExtractor());
                        break;
                    default:
                        throw new IllegalArgumentException("Unsupported method " + name);
                }

                methodHandle = MethodHandles.insertArguments(methodHandle, 1, jsonExtractor);

                // remove the pattern argument
                arguments = new ArrayList<>(arguments);
                arguments.remove(1);
                arguments = ImmutableList.copyOf(arguments);
            }
            else {
                JsonExtractCache<?> cache;
                switch (name) {
                    case JSON_EXTRACT_SCALAR_FUNCTION_NAME:
                        methodHandle = dynamicJsonExtract;
                        cache = new JsonExtractCache<>(20, new Supplier<JsonExtractor<Slice>>()
                        {
                            @Override
                            public JsonExtractor<Slice> get()
                            {
                                return new ScalarValueJsonExtractor();
                            }
                        });
                        break;
                    case JSON_EXTRACT_FUNCTION_NAME:
                        methodHandle = dynamicJsonExtract;
                        cache = new JsonExtractCache<>(20, new Supplier<JsonExtractor<Slice>>()
                        {
                            @Override
                            public JsonExtractor<Slice> get()
                            {
                                return new JsonValueJsonExtractor();
                            }
                        });
                        break;
                    case JSON_SIZE_FUNCTION_NAME:
                        methodHandle = dynamicJsonSize;
                        cache = new JsonExtractCache<>(20, new Supplier<JsonExtractor<Long>>()
                        {
                            @Override
                            public JsonExtractor<Long> get()
                            {
                                return new JsonSizeExtractor();
                            }
                        });
                        break;
                    default:
                        throw new IllegalArgumentException("Unsupported method " + name);
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.scalar.JsonExtract.JsonSizeExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.