From dev-return-2123-archive-asf-public=cust-asf.ponee.io@datafu.apache.org Thu Mar 22 13:43:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id AE63918067E for ; Thu, 22 Mar 2018 13:43:04 +0100 (CET) Received: (qmail 74993 invoked by uid 500); 22 Mar 2018 12:43:03 -0000 Mailing-List: contact dev-help@datafu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@datafu.apache.org Delivered-To: mailing list dev@datafu.apache.org Received: (qmail 74982 invoked by uid 99); 22 Mar 2018 12:43:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2018 12:43:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 05B54C00D6 for ; Thu, 22 Mar 2018 12:43:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yf8wVeBy2gAf for ; Thu, 22 Mar 2018 12:43:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7D1A25F2F2 for ; Thu, 22 Mar 2018 12:43:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B2B27E0CF4 for ; Thu, 22 Mar 2018 12:43:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1C685214D6 for ; Thu, 22 Mar 2018 12:43:00 +0000 (UTC) Date: Thu, 22 Mar 2018 12:43:00 +0000 (UTC) From: "Eyal Allweil (JIRA)" To: dev@datafu.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DATAFU-127) New macro - samply by keys MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DATAFU-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16409458#comment-16409458 ] Eyal Allweil commented on DATAFU-127: ------------------------------------- The reason I used (and prefer) _sample_ over _filter_ is that this macro really is meant for making a sample. After all, filtering by keys it's basically just doing an inner join, you don't need a macro for that. Also, the macro preserves all the fields that exist in the original, which is usually a waste. We use it for preparing samples of large tables to use afterwards in development or CI - which fields will be used isn't necessarily known or going to remain the same over time. > New macro - samply by keys > -------------------------- > > Key: DATAFU-127 > URL: https://issues.apache.org/jira/browse/DATAFU-127 > Project: DataFu > Issue Type: New Feature > Reporter: Eyal Allweil > Assignee: Eyal Allweil > Priority: Major > Labels: macro > Attachments: DATAFU-127.patch > > > Two macros that return a sample of a larger table based on a list of keys, with the schema of the larger table. One of the macros filters by dates, the other doesn't. > If there are multiple rows with a key that appears in the key list, all of them will be returned (no deduplication is done). The results are returned ordered by the key field in a single file. > The implementation uses a replicated join for efficiency, but this means the key list shouldn't be too large as to not fit in memory. > The first macro's definition looks as follows: > DEFINE sample_by_keys(table, sample_set, join_key_table, join_key_sample) returns out { > - table_name - table name to sample > - sample_set - a set of keys > - join_key_table - join column name in the table > - join_key_sample - join column name in the sample -- This message was sent by Atlassian JIRA (v7.6.3#76005)