<commit_before>package org.sample.serverless.aws.couchbase;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.N1qlQueryResult;
import static com.couchbase.client.java.query.dsl.Expression.i;
import static com.couchbase.client.java.query.Select.select;

/**
 * @author arungupta
 */
public class BucketGetAll implements RequestHandler<Book, String> {

    LambdaLogger logger;

    @Override
    public String handleRequest(Book request, Context context) {
        N1qlQuery query = N1qlQuery
                .simple(select("*")
                .from(i(CouchbaseUtil.getBucketName()))
                .limit(10));
//        N1qlQuery query = N1qlQuery.simple("SELECT * FROM " + CouchbaseUtil.getBucketName() + " LIMIT 10");

        N1qlQueryResult result = CouchbaseUtil.getBucket(logger).query(query);
        return result.allRows().toString();
    }

    public static void main(String[] args) {
        N1qlQuery query = N1qlQuery.simple("SELECT * FROM " + CouchbaseUtil.getBucketName() + " LIMIT 10");

        String result = CouchbaseUtil.getBucket(null).query(query).allRows().toString();
        System.out.println(result);
    }
}<commit_msg>printing API Gateway result as well<commit_after>package org.sample.serverless.aws.couchbase;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.N1qlQueryResult;
import static com.couchbase.client.java.query.dsl.Expression.i;
import org.sample.serverless.aws.couchbase.apigateway.APIGatewayUtil;
import static com.couchbase.client.java.query.Select.select;

/**
 * @author arungupta
 */
public class BucketGetAll implements RequestHandler<Book, String> {

    protected LambdaLogger logger;

    @Override
    public String handleRequest(Book request, Context context) {
        N1qlQuery query = N1qlQuery
                .simple(select("*")
                .from(i(CouchbaseUtil.getBucketName()))
                .limit(10));
//        N1qlQuery query = N1qlQuery.simple("SELECT * FROM " + CouchbaseUtil.getBucketName() + " LIMIT 10");

        N1qlQueryResult result = CouchbaseUtil.getBucket(logger).query(query);
        return result.allRows().toString();
    }

    public static void main(String[] args) {
        N1qlQuery query = N1qlQuery.simple("SELECT * FROM " + CouchbaseUtil.getBucketName() + " LIMIT 10");

        String result = CouchbaseUtil.getBucket(null).query(query).allRows().toString();
        System.out.println("Lambda: " + result);
        System.out.println("API Gateway: " + APIGatewayUtil.proxyIntegration(200, APIGatewayUtil.CONTENT_TYPE_JSON_HEADER, result));
    }
}
{'fraction_non_alphanumeric': 0.11946308724832215, 'fraction_numerical': 0.011073825503355705, 'mean_word_length': 3.784911717495987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '23790', 'n_tokens_mistral': 911, 'n_tokens_neox': 888, 'n_words': 152}